From c395134a755e989a4ab5ebef3bc1916bfcfe1ae3 Mon Sep 17 00:00:00 2001 From: samuel-p Date: Tue, 12 Jan 2021 20:38:21 +0100 Subject: [PATCH] extended update-notify.sh to send a notification if a reboot is needed --- update-notify.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/update-notify.sh b/update-notify.sh index d31f4eb..3e7e621 100644 --- a/update-notify.sh +++ b/update-notify.sh @@ -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