X-Git-Url: https://iankelling.org/git/?p=distro-setup;a=blobdiff_plain;f=system-status;h=49f734a63243aee83d33f3a641583e5b53231d8c;hp=c92bc9a9656583b253d5619f8d97b9ddeffe6260;hb=343a048be4b32d18540c6531048d2b9a006774ae;hpb=50e3ebaf4941651899a3b52b5245052c3f4ed725 diff --git a/system-status b/system-status index c92bc9a..49f734a 100755 --- a/system-status +++ b/system-status @@ -18,16 +18,16 @@ write-status() { chars=() glob=(/nocow/btrfs-stale/*) - if [[ -e $glob ]] ; then + if [[ -e ${glob[0]} ]]; then chars+=("STALE!") fi glob=(/m/md/bounces/new/*) - if [[ -e $glob ]]; then + if [[ -e ${glob[0]} ]]; then chars+=("BOUNCE!") lo -1 bounce "message in /m/md/bounces/new" fi glob=(/m/md/alerts/new/* /m/md/alerts/cur/*) - if [[ -e $glob ]]; then + if [[ -e ${glob[0]} ]]; then chars+=("ALERT!") fi if [[ -e /nocow/user/mailtest-failure ]]; then @@ -39,7 +39,7 @@ write-status() { fi source /a/bin/bash_unpublished/source-state - if [[ $MAIL_HOST == $HOSTNAME ]]; then + if [[ $MAIL_HOST == "$HOSTNAME" ]]; then if [[ $(systemctl is-active btrbk.timer) != active ]]; then chars+=("BTRBK.TIMER!") lo -60 btrbk.timer "btrbk.timer not enabled" @@ -65,13 +65,13 @@ write-status() { cat /a/bin/bash_unpublished/source-state >$status_file - if [[ $chars ]]; then + if [[ ${chars[*]} ]]; then echo "ps_char=\"${chars[*]} \$ps_char\"" >>$status_file fi } write-status -if [[ $@ ]]; then +if [[ $1 ]]; then cat $status_file exit 0 fi