Skip to content
Snippets Groups Projects
Commit e6025939 authored by Bob Mottram's avatar Bob Mottram
Browse files

Ensure that notification user does not already exist

parent 63542b07
No related branches found
No related tags found
No related merge requests found
......@@ -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 deluser "notification@$HOSTNAME" 2> /dev/null
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
prosodyctl deluser "notification@$HOSTNAME" 2> /dev/null
fi
fi
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment