From d9d3563b54607e1e6025605fd9e55b0a35c3cfcd Mon Sep 17 00:00:00 2001
From: Bob Mottram <bob@freedombone.net>
Date: Thu, 5 Jul 2018 18:38:06 +0100
Subject: [PATCH] Longer pause

---
 src/freedombone-notification | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/freedombone-notification b/src/freedombone-notification
index 9f1f8d4b2..5cd7ce0dc 100755
--- a/src/freedombone-notification
+++ b/src/freedombone-notification
@@ -83,8 +83,7 @@ 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 deluser "notification@$HOSTNAME" 2> /dev/null
-    if prosodyctl register "notification" "$HOSTNAME" "$notification_user_password" 2> /dev/null; then
+    if prosodyctl register "notification" "$HOSTNAME" "$notification_user_password"; then
         { echo '#!/usr/bin/python2';
           echo 'import sys,os,xmpp,time';
           echo 'tojid = sys.argv[1]';
@@ -101,14 +100,14 @@ if [ -d /etc/prosody ]; then
           echo 'if not auth:';
           echo '    sys.exit()';
           echo 'id=cl.send(xmpp.protocol.Message(tojid, msg))';
-          echo 'time.sleep(1)';
+          echo 'time.sleep(2)';
           echo 'cl.disconnect()'; } > /tmp/xsend
         chmod +x /tmp/xsend
 
         echo "$MESSAGE" | python2 /tmp/xsend "$ADMIN_EMAIL_ADDRESS"
         rm /tmp/xsend
-        prosodyctl deluser "notification@$HOSTNAME" 2> /dev/null
     fi
+    prosodyctl deluser "notification@$HOSTNAME"
 fi
 
 exit 0
-- 
GitLab