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
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"
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