mirror of
https://github.com/dutchcoders/transfer.sh.git
synced 2024-11-27 06:30:19 +01:00
additional function alias
This commit is contained in:
parent
f0c57b8de1
commit
ef88c579b4
1 changed files with 30 additions and 8 deletions
22
README.md
22
README.md
|
@ -33,6 +33,28 @@ transfer() {
|
||||||
alias transfer=transfer
|
alias transfer=transfer
|
||||||
===
|
===
|
||||||
$ transfer test.txt
|
$ transfer test.txt
|
||||||
|
|
||||||
|
Alias virus scan transfer >> .bashrc or .zshrc:
|
||||||
|
===
|
||||||
|
tansfercheck() {
|
||||||
|
if [ $# -eq 0 ];
|
||||||
|
then echo -e "No arguments specified. Usage:\n transfercheck /tmp/test.md\ncat /tmp/test.md | transfercheck test.md";
|
||||||
|
return 1;
|
||||||
|
fi
|
||||||
|
# write to output to tmpfile for progress bar
|
||||||
|
tmpfile=$( mktemp -t transferXXX)
|
||||||
|
if tty -s;
|
||||||
|
then basefile=$(basename "$1" | sed -e 's/[^a-zA-Z0-9._-]/-/g');
|
||||||
|
curl -X PUT --progress-bar --upload-file $1 https://transfer.sh/$basefile/virustotal >> $tmpfile;
|
||||||
|
else curl -X PUT --progress-bar --upload-file "-" "https://transfer.sh/$1/virustotal" >> $tmpfile ;
|
||||||
|
fi
|
||||||
|
cat $tmpfile;
|
||||||
|
rm -f $tmpfile;
|
||||||
|
}
|
||||||
|
alias transfercheck=transfercheck
|
||||||
|
===
|
||||||
|
$ transfercheck suspicious.pdf
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
Loading…
Reference in a new issue