Introduction
Introduction Statistics Contact Development Disclaimer Help
pubsub_setup: return exit code, write errors to stderr, OK to stdout - pubsubhu…
git clone git://git.codemadness.org/pubsubhubbubblub
Log
Files
Refs
README
LICENSE
---
commit 14fe35c0d15bb77075e2a7bd225884510b431eba
parent e62f5cc6b38cd2f629b639699678e248a456d3e1
Author: Hiltjo Posthuma <[email protected]>
Date: Sat, 28 May 2022 12:36:33 +0200
pubsub_setup: return exit code, write errors to stderr, OK to stdout
Diffstat:
M pubsub_setup | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
---
diff --git a/pubsub_setup b/pubsub_setup
@@ -26,6 +26,11 @@ sha() {
# log(s)
log() {
+ echo "$1"
+}
+
+# log_error(s)
+log_error() {
echo "$1" >&2
}
@@ -54,7 +59,7 @@ subscribe() {
log "${mode} OK"
return 0
else
- log "${mode} FAIL"
+ log_error "${mode} FAIL"
return 1
fi
}
@@ -108,6 +113,7 @@ secret=$(cat "${f}" 2>/dev/null)
callback="${base}${feedname}/${token}"
+status=0
if test "${dosubscribe}" = "1"; then
f="config/${feedname}/hub"
if test -f "${f}"; then
@@ -120,6 +126,8 @@ if test "${dosubscribe}" = "1"; then
printf '%s\n' "${callback}" > "config/${feedname}/callback"
printf '%s\n' "${hub}" > "config/${feedname}/hub"
printf '%s\n' "${topic}" > "config/${feedname}/topic"
+ else
+ status=1
fi
fi
@@ -129,5 +137,9 @@ if test "${dounsubscribe}" = "1"; then
rm -f "config/${feedname}/callback"
rm -f "config/${feedname}/hub"
rm -f "config/${feedname}/topic"
+ else
+ status=1
fi
fi
+
+exit $status
You are viewing proxied material from codemadness.org. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.