From c1db63cc6bd47d9d902382d57efd8ddf35a2cb95 Mon Sep 17 00:00:00 2001 From: Pacien TRAN-GIRARD Date: Fri, 27 Jan 2017 23:19:51 +0100 Subject: Use paste.gnugen.ch service --- post-screenshot.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/post-screenshot.sh b/post-screenshot.sh index a798dd1..edca85e 100755 --- a/post-screenshot.sh +++ b/post-screenshot.sh @@ -1,8 +1,8 @@ #!/usr/bin/env sh LOCAL_DIR="/home/pacien/medias/pictures/screenshots" -REMOTE_DIR="nginx.berlioz:/var/www/files.pacien.net/screenshots" -BASE_URL="https://files.pacien.net/screenshots" +REMOTE_SERVICE_URL="https://paste.gnugen.ch" +PASTE_EXPIRATION="1d" TS=$(date +"%s") RAND=$(shuf -i 1000-9999 -n 1) @@ -13,10 +13,9 @@ FILE="$LOCAL_DIR/$FILE_NAME" scrot "$FILE" -s viewnior "$FILE" & -scp "$FILE" "$REMOTE_DIR/" +SCREENSHOT_URL=$(curl -F "file=@$FILE;type=image/png" -F "expire=$PASTE_EXPIRATION" -H "Expect:" "$REMOTE_SERVICE_URL") if [ $? -eq 0 ]; then - SCREENSHOT_URL="$BASE_URL/$FILE_NAME" notify-send --category=transfer.complete "Screenshot upload complete." "$SCREENSHOT_URL" echo -n "$SCREENSHOT_URL" | xclip -i else -- cgit v1.2.3