Last active
September 16, 2020 01:08
-
-
Save jamesduncombe/bbf87122ee31067a8ccb8783f3c871f8 to your computer and use it in GitHub Desktop.
Amnesia.io bash alias
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
amn() { | |
if [ $# -ge 1 -a ! -f $1 ]; then | |
input=$(cat -) | |
temp=$(mktemp) | |
echo $input > $temp | |
curl -sF "file=@$temp;filename=xyz.$1" https://amnesia.io | |
rm $temp | |
elif [ $# -ge 1 -a -f $1 ]; then | |
curl -sF "file=@$1" https://amnesia.io | |
else | |
echo "No filename provided (amn [filename])" | |
echo "Try:" | |
echo "amn [filename]" | |
echo "or" | |
echo "pbpaste | amn [filetype]" | |
echo "More info: https://amnesia.io" | |
return 1 | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment