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

Can send notifications as SSB private messages

parent 24867748
No related branches found
No related tags found
No related merge requests found
......@@ -146,6 +146,24 @@ if [ -d /etc/prosody ]; then
fi
fi
if [ -d /etc/scuttlebot/notification ]; then
if grep -q "SSB_NOTIFY=" "/root/${PROJECT_NAME}.cfg"; then
SSB_NOTIFY=$(grep 'SSB_NOTIFY=' "/root/${PROJECT_NAME}.cfg" | head -n 1 | sed 's|SSB_NOTIFY=||g')
if [[ "$SSB_NOTIFY" == '@'* && "$SSB_NOTIFY" == *'.ed25519' ]]; then
cat <<EOF > /usr/bin/send_scuttlebutt_notification
#!/bin/bash
cd /etc/scuttlebot/notification || exit 1
./ssb-example-pm.js $SSB_NOTIFY "$MESSAGE"
exit 0
EOF
chmod +x /usr/bin/install_scuttlebutt_notification
su -c '/usr/bin/install_scuttlebutt_notification' - scuttlebot
rm /usr/bin/install_scuttlebutt_notification
fi
fi
fi
if [ -f $notification_image_filename ]; then
rm $notification_image_filename
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