integrate gotify notification commands
This commit is contained in:
parent
03351da5a0
commit
0262d93deb
|
@ -10,7 +10,9 @@ if [[ $EUID -ne 0 ]]; then
|
|||
fi
|
||||
|
||||
# vars gotify
|
||||
readonly TOKEN="<TOKEN_GOTIFY_APP>"
|
||||
readonly GOTIFY_TOKEN="<TOKEN_GOTIFY_APP>"
|
||||
readonly GOTIFY_HOST="<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
|
||||
|
|
Loading…
Reference in New Issue