ily.li/assets/files/upload_file.sh
2020-07-06 10:49:18 +02:00

19 lines
294 B
Bash
Executable File

#!/bin/sh
local_file=$1
slug=$2
token=$(cat "$HOME/.ily_token")
if test -z "$slug"; then
method=POST
else
method=PUT
fi
curl -X $method -H 'Accept: text/plain' \
-H "Authorization: $token" \
-F 'type=file' \
-F "upload=@$local_file" \
-F 'ttl=2592000' \
"https://ily.li/$slug"