diff options
author | pacien | 2017-09-07 10:00:06 +0200 |
---|---|---|
committer | pacien | 2017-09-07 10:00:06 +0200 |
commit | 26dc11c6c5f6ba6584bd273f5cd93ae527a0a383 (patch) | |
tree | 63e6de832bfbcb8a9ecc0fddc3efb345fd40edad | |
parent | fa67270248f18135c37b9ce80664b20b139d7ffd (diff) | |
download | desktop-utilities-26dc11c6c5f6ba6584bd273f5cd93ae527a0a383.tar.gz |
Revert "Use paste.gnugen.ch service"; Update endpoint
This reverts commit c1db63cc6bd47d9d902382d57efd8ddf35a2cb95.
-rwxr-xr-x | post-screenshot.sh | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/post-screenshot.sh b/post-screenshot.sh index a4ee752..7592665 100755 --- a/post-screenshot.sh +++ b/post-screenshot.sh | |||
@@ -1,8 +1,8 @@ | |||
1 | #!/usr/bin/env sh | 1 | #!/usr/bin/env sh |
2 | 2 | ||
3 | LOCAL_DIR="$HOME/pictures/screenshots" | 3 | LOCAL_DIR="$HOME/pictures/screenshots" |
4 | REMOTE_SERVICE_URL="https://paste.gnugen.ch" | 4 | REMOTE_DIR="nas.lsn:/home/pacien/www/net.pacien.files/screenshots" |
5 | PASTE_EXPIRATION="1d" | 5 | BASE_URL="https://files.pacien.net/screenshots" |
6 | 6 | ||
7 | TS=$(date +"%s") | 7 | TS=$(date +"%s") |
8 | RAND=$(shuf -i 1000-9999 -n 1) | 8 | RAND=$(shuf -i 1000-9999 -n 1) |
@@ -13,9 +13,10 @@ FILE="$LOCAL_DIR/$FILE_NAME" | |||
13 | scrot "$FILE" -s | 13 | scrot "$FILE" -s |
14 | viewnior "$FILE" & | 14 | viewnior "$FILE" & |
15 | 15 | ||
16 | SCREENSHOT_URL=$(curl -F "file=@$FILE;type=image/png" -F "expire=$PASTE_EXPIRATION" -H "Expect:" "$REMOTE_SERVICE_URL") | 16 | scp "$FILE" "$REMOTE_DIR/" |
17 | 17 | ||
18 | if [ $? -eq 0 ]; then | 18 | if [ $? -eq 0 ]; then |
19 | SCREENSHOT_URL="$BASE_URL/$FILE_NAME" | ||
19 | notify-send --category=transfer.complete "Screenshot upload complete." "$SCREENSHOT_URL" | 20 | notify-send --category=transfer.complete "Screenshot upload complete." "$SCREENSHOT_URL" |
20 | echo -n "$SCREENSHOT_URL" | xclip -i | 21 | echo -n "$SCREENSHOT_URL" | xclip -i |
21 | else | 22 | else |