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

Also notify via xmpp

parent 1d85ddb3
No related branches found
No related tags found
No related merge requests found
......@@ -764,6 +764,7 @@ function xmpp_modules {
echo ' "http";';
echo ' "http_upload";';
echo ' "websocket";';
echo ' "post_msg";';
echo ' "throttle_presence"; -- Reduce battery and bandwidth usage';
echo ' "filter_chatstates"; -- Reduce battery and bandwidth usage';
echo '};'; } >> "$filename"
......
......@@ -81,4 +81,11 @@ if [ "$SUBJECT" ]; then
echo "$MESSAGE" | mail -s "$SUBJECT" "$ADMIN_EMAIL_ADDRESS"
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"
fi
exit 0
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