2020-06-27 17:50:28 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
local_file=$1
|
|
|
|
token=$(cat $HOME/.ily_token)
|
|
|
|
|
|
|
|
if test -z "$2"; then
|
2020-07-05 19:43:56 +02:00
|
|
|
curl -X POST -H 'Accept: text/plain' \
|
|
|
|
-H "Authorization: $token" \
|
|
|
|
-F 'type=file' \
|
|
|
|
-F 'upload=@'$local_file \
|
|
|
|
-F 'ttl=2592000' \
|
|
|
|
https://ily.li/
|
2020-06-27 17:50:28 +02:00
|
|
|
else
|
2020-07-05 19:43:56 +02:00
|
|
|
curl -X PUT -H 'Accept: text/plain' \
|
|
|
|
-H "Authorization: $token" \
|
|
|
|
-F 'type=file' \
|
|
|
|
-F 'upload=@'$local_file \
|
|
|
|
-F 'ttl=2592000' \
|
|
|
|
"https://ily.li/$2"
|
2020-06-27 17:50:28 +02:00
|
|
|
fi
|