From e76752cb838b6a9b6e33afa70b99e22912bcb5e7 Mon Sep 17 00:00:00 2001 From: Johannes Löthberg Date: Thu, 10 Sep 2015 14:15:10 +0200 Subject: (s)sl: Let dumpwatch take care of uploading MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Johannes Löthberg --- ssl | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'ssl') diff --git a/ssl b/ssl index 543f7b3..b052033 100755 --- a/ssl +++ b/ssl @@ -1,14 +1,20 @@ #!/usr/bin/env bash +## +# Create a screenshot using scrot, then dump it in ~/dumpdir for +# dumpwatch to upload it to the appropriate server. +# +# This script requires dumpwatch to already be running. +# + set -o errexit -id=$(mktemp /tmp/XXXXXXXXXX).png -host='theos.kyriasis.com' -url="https://$host/~kyrias/s/$(basename $id)" +if [[ -z "$TMPDIR" ]]; then + TMPDIR=/tmp +fi + +file=$(mktemp -u XXXXXXXXXX.png) -scrot -s "$id" -scp -q "$id" "$host":public_html/s/ -rm "$id" +scrot -s "$TMPDIR"/"$file" -printf "URL: %s\n" "$url" -printf "%s\n" "$url" | xclip -selection clipboard +mv "$TMPDIR"/"$file" "$HOME"/dumpdir/"$file" -- cgit v1.2.3-70-g09d2