aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Löthberg <johannes@kyriasis.com>2015-05-05 18:29:02 +0200
committerJohannes Löthberg <johannes@kyriasis.com>2015-05-05 18:29:02 +0200
commita1ba95b12951596993a4aff14f02a9e6ccf7a1d4 (patch)
treef29b1bdfda812fc330ce909be189bf7a61c46ce4
parent6e069a03f5cc995d85f2293495c208a0994b0275 (diff)
downloadbin-a1ba95b12951596993a4aff14f02a9e6ccf7a1d4.tar.xz
update pomf scripts
-rwxr-xr-xpomf7
-rwxr-xr-xscrotpomf.bash6
2 files changed, 9 insertions, 4 deletions
diff --git a/pomf b/pomf
index 051a0da..9c2e26d 100755
--- a/pomf
+++ b/pomf
@@ -1,4 +1,7 @@
#!/usr/bin/env bash
-upload=$(curl -sf -F "files[]=@\"$1\"" http://pomf.se/upload.php)
+
+set -o errexit
+
+upload=$(curl -sf -F "files[]=@\"$1\"" https://pomf.se/upload.php)
geturl=$(jshon -e files -e 0 -e url -u <<< $upload)
-printf "%s/%s\n" "http://a.pomf.se" "$geturl"
+printf "%s/%s\n" "https://a.pomf.se" "$geturl"
diff --git a/scrotpomf.bash b/scrotpomf.bash
index bb679fc..518998b 100755
--- a/scrotpomf.bash
+++ b/scrotpomf.bash
@@ -1,5 +1,7 @@
#!/usr/bin/env bash
+set -o errexit
+
SCROTARGS=()
while (( "$#" )); do
SCROTARGS+=($1)
@@ -11,10 +13,10 @@ FILE="$(scrot ${SCROTARGS[@]} -e 'echo -n $f')"
# upload it and grab the URL
printf "Uploading scrot\n"
-JSON="$(curl -sf -F "files[]=@$FILE" http://pomf.se/upload.php)"
+JSON="$(curl -sf -F "files[]=@$FILE" https://pomf.se/upload.php)"
BASE="$(jshon -e files -e 0 -e url -u <<< $JSON)"
-URL="http://a.pomf.se/$BASE"
+URL="https://a.pomf.se/$BASE"
# copy the URL to the clipboard
if [[ "$(type -p xclip)" ]]; then