aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Löthberg <johannes@kyriasis.com>2015-09-10 14:15:10 +0200
committerJohannes Löthberg <johannes@kyriasis.com>2015-09-10 14:15:10 +0200
commite76752cb838b6a9b6e33afa70b99e22912bcb5e7 (patch)
treef3d21acc5de2ac45d08d90bcfc778053d6d053a8
parent037e4f926438a0f66f5e30a7bffe2a0bd8787f9c (diff)
downloadbin-e76752cb838b6a9b6e33afa70b99e22912bcb5e7.tar.xz
(s)sl: Let dumpwatch take care of uploading
Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>
-rwxr-xr-xsl22
-rwxr-xr-xssl22
2 files changed, 28 insertions, 16 deletions
diff --git a/sl b/sl
index 4404797..c5145c0 100755
--- a/sl
+++ b/sl
@@ -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 "$id"
-scp -q "$id" "$host":public_html/s/
-rm "$id"
+scrot "$TMPDIR"/"$file"
-printf "URL: %s\n" "$url"
-printf "%s\n" "$url" | xclip -selection clipboard
+mv "$TMPDIR"/"$file" "$HOME"/dumpdir/"$file"
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"