diff --git a/updates_notifier.sh b/updates_notifier.sh index 9aafc0d..805832b 100644 --- a/updates_notifier.sh +++ b/updates_notifier.sh @@ -10,7 +10,9 @@ if [[ $EUID -ne 0 ]]; then fi # vars gotify -readonly TOKEN="" +readonly GOTIFY_TOKEN="" +readonly GOTIFY_HOST="" +readonly GOTIFY_PRIORITY=5 apt update -qq @@ -26,5 +28,9 @@ else updates=$(echo $updates|tr -d '\n') OUT="There are **$num** updates: \r" OUT="${OUT} Packages: *$updates*" - sh ./utils/gotifypush.sh "$(hostname) pending updates" "$OUT" 5 $TOKEN + + # send gotify notification + TITLE="$(hostname) pending updates" + EXTRAS="{\"client::display\": {\"contentType\": \"text/markdown\"}}" + curl -X POST "$GOTIFY_HOST/message?token=$GOTIFY_TOKEN" -H "accept: application/json" -H "Content-Type: application/json" -d "{ \"message\": \"${OUT}\", \"priority\": ${GOTIFY_PRIORITY}, \"title\": \"${TITLE}\", \"extras\": ${EXTRAS} }" fi