From a2e1d274224e7e5e6a9afd519fdbe5276c4f08c1 Mon Sep 17 00:00:00 2001 From: Pacien TRAN-GIRARD Date: Mon, 7 Mar 2016 09:42:38 +0100 Subject: Add screenshot web publishing script --- post-screenshot.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100755 post-screenshot.sh diff --git a/post-screenshot.sh b/post-screenshot.sh new file mode 100755 index 0000000..df8acf2 --- /dev/null +++ b/post-screenshot.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env sh + +LOCAL_DIR="/home/pacien/medias/pictures/screenshots" +REMOTE_DIR="nginx.l:/var/www/files.pacien.net/screenshots" +BASE_URL="https://files.pacien.net/screenshots" + +TS=$(date +"%s") +RAND=$(shuf -i 1000-9999 -n 1) + +FILE_NAME="$TS$RAND.png" +FILE="$LOCAL_DIR/$FILE_NAME" + +scrot "$FILE" -s +viewnior "$FILE" & +scp "$FILE" "$REMOTE_DIR/" & +echo -n "$BASE_URL/$FILE_NAME" | xclip -i -- cgit v1.2.3