From bfe6426a9bbc89907ff2d7fc44158235521856b3 Mon Sep 17 00:00:00 2001 From: Lucas Date: Thu, 2 Jul 2020 03:09:10 +0000 Subject: [PATCH] pstsrv: ensure newline after URL and inform failed upload --- bin/pstsrv.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/bin/pstsrv.sh b/bin/pstsrv.sh index ea0a6d8..a76efe4 100644 --- a/bin/pstsrv.sh +++ b/bin/pstsrv.sh @@ -86,15 +86,18 @@ shift check_runtime curl $torsocks +url= [ $# -eq 0 ] && set -- - case $srv in catbox.moe) - do_upload pst_catbox_moe "$@" + url=$(do_upload pst_catbox_moe "$@") ;; ix.io) - do_upload pst_ix_io "$@" + url=$(do_upload pst_ix_io "$@") ;; *) err "unknown service $srv" ;; esac +[ $? -eq 0 ] || err "Couldn't upload files" +printf "%s\n" "$url"