2
0
Fork 0
main
Ducky 2024-04-02 02:36:24 +01:00
parent 1cc4c432b2
commit de84153bfc
1 changed files with 26 additions and 0 deletions

View File

@ -30,6 +30,25 @@ function del_pidfile() {
rm -f "$pidfile"
}
function check_updates() {
function notify_update() {
prog="$1"
count="$2"
/usr/local/bin/sh.zio.notify \
--level "warning" \
--message "**$(hostname -f)** completed startup at $(date "+%d-%b-%Y %H:%M:%S %Z")" \
--title "Node online"
}
if [[ -x "$(command -v dnf)" ]]; then
dnf_updates="$(dnf check-update -q|grep -c ^[a-z0-9])"
if [[ $dnf_updates > 0 ]]; then
notify_update "dnf" "$dnf_updates"
fi
if
}
function notify_startup() {
/usr/local/bin/sh.zio.notify \
--level "info" \
@ -41,6 +60,13 @@ function main() {
check_pidfile
notify_startup
#while :
#do
# check_updates()
# sleep 3600
#done
sleep infinity
del_pidfile