Update upload scripts for ily.li
This commit is contained in:
parent
bc726fe81f
commit
90e6fbdca1
@ -8,13 +8,7 @@ file_name+=$base_name
|
||||
|
||||
flameshot gui -r > $file_name
|
||||
|
||||
sftp -oPort=4242 gaudonpr@ftp.gaudon.pro << EOT
|
||||
cd public_html/push.arisu.fr/
|
||||
put $file_name
|
||||
EOT
|
||||
|
||||
url="https://push.arisu.fr/"
|
||||
url+=$base_name
|
||||
url=$(sh $(dirname $0)/push_file.sh $file_name)
|
||||
|
||||
echo $url | xclip -selection clipboard
|
||||
|
||||
|
@ -7,13 +7,7 @@ base_name=$latest_screenshot
|
||||
|
||||
file_name+=$base_name
|
||||
|
||||
sftp -oPort=4242 gaudonpr@ftp.gaudon.pro << EOT
|
||||
cd public_html/push.arisu.fr/
|
||||
put $file_name
|
||||
EOT
|
||||
|
||||
url="https://push.arisu.fr/"
|
||||
url+=$base_name
|
||||
url=$(sh $(dirname $0)/push_file.sh $file_name)
|
||||
|
||||
echo $url | xclip -selection clipboard
|
||||
|
||||
|
18
push_file.sh
Executable file
18
push_file.sh
Executable file
@ -0,0 +1,18 @@
|
||||
#!/bin/sh
|
||||
|
||||
local_file=$1
|
||||
token=$(cat $HOME/.ily_token)
|
||||
|
||||
if test -z "$2"; then
|
||||
curl -X POST -H 'Accept: text/plain' \
|
||||
-H "Authorization: $token" \
|
||||
-F 'upload=@'$local_file \
|
||||
-F 'ttl=2592000' \
|
||||
https://ily.li/
|
||||
else
|
||||
curl -X PUT -H 'Accept: text/plain' \
|
||||
-H "Authorization: $token" \
|
||||
-F 'upload=@'$local_file \
|
||||
-F 'ttl=2592000' \
|
||||
"https://ily.li/$2"
|
||||
fi
|
Loading…
Reference in New Issue
Block a user