X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=system-status;h=ae37d3b02cf26782d07ac1a90019403d0c1699d0;hb=HEAD;hp=d6269d9c825f89b30a67cc5cb7e1f3512f278dfa;hpb=1f027ea146ea6c62002a8f67f831273a5c431b52;p=distro-setup diff --git a/system-status b/system-status index d6269d9..34ad07a 100755 --- a/system-status +++ b/system-status @@ -290,8 +290,8 @@ write-status() { # shellcheck disable=SC2016 # exim var, not a bash bar if (( $(date -d "$(exim -Mset $mid -be <<<'$h_date:' | sed -n 's/^> *//;/./p')" +%s) < EPOCHSECONDS )); then if ip a show veth0-mail &>/dev/null; then - pid=$(pgrep -f "/usr/sbin/exim4 -bd -q30m -C /etc/exim4/my.conf"|head -n1); - nsenter -t $pid -n -m /usr/sbin/exim4 -C /etc/exim4/my.conf -M $mid + pid=$(pgrep -f "/usr/sbin/exim4 -bd -q30m -C /etc/exim4/nn-mainlog.conf"|head -n1); + nsenter -t $pid -n -m /usr/sbin/exim4 -C /etc/exim4/nn-mainlog.conf -M $mid else /usr/sbin/exim4 -M $mid fi @@ -309,6 +309,20 @@ write-status() { # check email. $MAIL_HOST) p $qmsg | loday -120 qlen + + + f=/var/spool/exim4/gw/no-delay-eximids + if (( loop_count % 10 == 0 )) && \ + [[ -s $f ]] && [[ $(cat $f) == all ]]; then + # I've left this on longer than I intended, so just auto-delete + # it after some time. + find $f -mmin +180 -delete + if [[ -s $f ]]; then + chars+=("NO_DELAY") + fi + fi + + ;; *) rmg /home/iank/cron-errors/qlen* @@ -433,39 +447,42 @@ write-status() { echo "ps_char=\"${chars[*]} \$ps_char\"" >>$status_file fi fi -} + + if [[ -e $HOME/.iank-stream-on ]] && ! pgrep -fc '^ffmpeg.*icecast://source.*/fsf-sysops' >/dev/null; then + rm -f $HOME/.iank-stream-on + fi + +} # end write-status # This prevents me having to mute notifications when I'm going to bed. mute() { local locked export DISPLAY=:0 locked=false - if lock_info=$(xscreensaver-command -time); then + if lock_info=$(xscreensaver-command -time 2>/dev/null); then if [[ $lock_info != *non-blanked* ]]; then locked=true fi - else - locked=true - fi - midnight=$(date -d 00:00 +%s) - mdiff=$(( EPOCHSECONDS - midnight )) - if $locked && (( mdiff < 6 *60*60 || mdiff > 21 *60*60 )); then - case $(pactl get-sink-mute @DEFAULT_SINK@ | awk '{print $2}') in - no) - # for log purposes - echo muted - pactl set-sink-mute @DEFAULT_SINK@ true - ;; - esac - fi - if ! $locked && (( mdiff > 6 *60*60 || mdiff < 12 *60*60 )) && [[ ! -e /tmp/ianknap ]]; then - case $(pactl get-sink-mute @DEFAULT_SINK@ | awk '{print $2}') in - yes) - # for log purposes - echo unmuted - pactl set-sink-mute @DEFAULT_SINK@ false - ;; - esac + midnight=$(date -d 00:00 +%s) + mdiff=$(( EPOCHSECONDS - midnight )) + if $locked && (( mdiff < 6 *60*60 || mdiff > 21 *60*60 )); then + case $(pactl get-sink-mute @DEFAULT_SINK@ | awk '{print $2}') in + no) + # for log purposes + echo muted + pactl set-sink-mute @DEFAULT_SINK@ true + ;; + esac + fi + if ! $locked && (( mdiff > 6 *60*60 || mdiff < 12 *60*60 )) && [[ ! -e /tmp/ianknap ]]; then + case $(pactl get-sink-mute @DEFAULT_SINK@ | awk '{print $2}') in + yes) + # for log purposes + echo unmuted + pactl set-sink-mute @DEFAULT_SINK@ false + ;; + esac + fi fi } @@ -485,24 +502,10 @@ main-loop() { if [[ -e /sys/class/power_supply/AC/online && $(