This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
transfercheck() { | |
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; |