various
parent
1cc4c432b2
commit
de84153bfc
|
@ -30,6 +30,25 @@ function del_pidfile() {
|
||||||
rm -f "$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() {
|
function notify_startup() {
|
||||||
/usr/local/bin/sh.zio.notify \
|
/usr/local/bin/sh.zio.notify \
|
||||||
--level "info" \
|
--level "info" \
|
||||||
|
@ -41,6 +60,13 @@ function main() {
|
||||||
check_pidfile
|
check_pidfile
|
||||||
|
|
||||||
notify_startup
|
notify_startup
|
||||||
|
|
||||||
|
#while :
|
||||||
|
#do
|
||||||
|
# check_updates()
|
||||||
|
# sleep 3600
|
||||||
|
#done
|
||||||
|
|
||||||
sleep infinity
|
sleep infinity
|
||||||
|
|
||||||
del_pidfile
|
del_pidfile
|
||||||
|
|
Loading…
Reference in New Issue