extended update-notify.sh to send a notification if a reboot is needed

This commit is contained in:
Samuel Philipp 2021-01-12 20:38:21 +01:00
parent 193cb7a2a7
commit c395134a75

View file

@ -19,3 +19,12 @@ echo "$UPDATE"
if [[ $UPDATE == *$'\n'* ]]; then
curl -F "title=$TITLE" -F "message=$UPDATE" -F "priority=5" "https://push.sp-codes.de/message?token=$GOTIFY_TOKEN"
fi
if [ -f /var/run/reboot-required ]; then
TITLE="Reboot required on $HOST"
MESSAGE="Reboot required\n"
if [ -f /var/run/reboot-required.pkgs ]; then
MESSAGE+=$(cat /var/run/reboot-required.pkgs)
fi
curl -F "title=$TITLE" -F "message=$MESSAGE" -F "priority=5" "https://push.sp-codes.de/message?token=$GOTIFY_TOKEN"
fi