2019-03-24 12:08:29 +00:00
|
|
|
#!/usr/bin/env sh
|
|
|
|
|
|
|
|
# Description: Upload a file to transfer.sh
|
|
|
|
#
|
|
|
|
# Shell: POSIX compliant
|
|
|
|
# Author: Arun Prakash Jana
|
|
|
|
|
|
|
|
if ! [ -z "$1" ]; then
|
|
|
|
# Upload the file, show the download link and wait till user presses any key
|
2019-11-21 20:44:25 +00:00
|
|
|
curl -s --upload-file "$1" https://transfer.sh/"$(basename "$1")"
|
2019-03-24 12:08:29 +00:00
|
|
|
echo
|
2019-11-21 20:44:25 +00:00
|
|
|
read -r _
|
2019-03-24 12:08:29 +00:00
|
|
|
|
|
|
|
# To write download link to "$1".loc and exit
|
|
|
|
# curl -s --upload-file "$1" https://transfer.sh/`basename "$1"` -o `basename "$1"`.loc
|
|
|
|
fi
|