From 20a6f997f98ec4926fbb2b92e39d7ee781c72a66 Mon Sep 17 00:00:00 2001 From: Bob Mottram <bob@freedombone.net> Date: Thu, 5 Jul 2018 13:50:33 +0100 Subject: [PATCH] Silent --- src/freedombone-app-xmpp | 2 +- src/freedombone-notification | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/freedombone-app-xmpp b/src/freedombone-app-xmpp index 618dc34cc..7c7292b09 100755 --- a/src/freedombone-app-xmpp +++ b/src/freedombone-app-xmpp @@ -1015,7 +1015,7 @@ function install_xmpp { $INSTALL_PACKAGES lua-sec lua-bitop lua5.1 liblua5.1-dev $INSTALL_PACKAGES libidn11-dev libssl-dev lua-dbi-sqlite3 - $INSTALL_PACKAGES mercurial + $INSTALL_PACKAGES mercurial curl $INSTALL_PACKAGES prosody if [ ! -f /usr/bin/hg ]; then diff --git a/src/freedombone-notification b/src/freedombone-notification index e77421f82..b80569d21 100755 --- a/src/freedombone-notification +++ b/src/freedombone-notification @@ -83,9 +83,10 @@ fi if [ -d /etc/prosody ]; then notification_user_password=$(openssl rand -base64 32 | tr -dc A-Za-z0-9 | head -c 30 ; echo -n '') - prosodyctl register "notification" "$HOSTNAME" "$notification_user_password" - curl http://localhost:5280/msg/user -u "notification@$HOSTNAME:$notification_user_password" -H "Content-Type: text/plain" -d "$MESSAGE" - prosodyctl deluser "notification@$HOSTNAME" + if prosodyctl register "notification" "$HOSTNAME" "$notification_user_password" 2> /dev/null; then + curl http://localhost:5280/msg/user -u "notification@$HOSTNAME:$notification_user_password" -H "Content-Type: text/plain" -d "$MESSAGE" 2> /dev/null + prosodyctl deluser "notification@$HOSTNAME" 2> /dev/nul + fi fi exit 0 -- GitLab