additional function alias

This commit is contained in:
Cameron Banowsky 2017-03-31 08:08:42 -07:00
parent f0c57b8de1
commit ef88c579b4

View file

@ -33,6 +33,28 @@ transfer() {
alias transfer=transfer
===
$ 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