if [[ ! -r $f ]] || (( $(( $(date +%s) - $(stat -c %Y $f ) )) > 60*60*12 )); then
m apt-get update
fi
- m DEBIAN_FRONTEND=noninteractive apt-get -y install --purge --auto-remove "$@"
+ DEBIAN_FRONTEND=noninteractive m apt-get -y install --purge --auto-remove "$@"
}
postmaster=alerts
chars+=("MAILPING!")
fi
- qlen=$(/usr/sbin/exiqgrep -o 60 -c -b | awk '{print $1}')
+ if ! qlen=$(/usr/sbin/exiqgrep -o 60 -c -b | awk '{print $1}'); then
+ # early in install process, we dont have permission yet for exiqgrep
+ qlen=$(sudo /usr/sbin/exiqgrep -o 60 -c -b | awk '{print $1}')
+ fi
if ((qlen)); then
chars+=("q $qlen")
fi