X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=system-status;h=ae37d3b02cf26782d07ac1a90019403d0c1699d0;hb=refs%2Fheads%2Fmaster;hp=2efb2dc3f485156f18e424b41c072e9d4c31266f;hpb=50f25d1eec109c4596cfc638c9a7c98da0f0b5d0;p=distro-setup diff --git a/system-status b/system-status index 2efb2dc..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* @@ -358,8 +372,10 @@ write-status() { if grep -qxF $HOSTNAME $x; then all_dirs+=( ${x%.hosts} ); fi done + script_files=("${my_service_scripts[@]}" "${my_bin_files[@]}" $my_lib_files) + # Just because i forget a lot, -mmin -NUM means files modified <= NUM minutes ago - if (( fmin < 0 )) && [[ $(find ${all_my_scripts[@]} ${all_dirs[@]} -mmin $fmin -type f -print -quit 2>/dev/null) ]]; then + if (( fmin < 0 )) && [[ $(find "${script_files[@]}" ${all_dirs[@]} -mmin $fmin -type f -print -quit 2>/dev/null) ]]; then v conflink newer filesystem files chars+=(CONFLINK) break @@ -431,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 } @@ -483,24 +502,10 @@ main-loop() { if [[ -e /sys/class/power_supply/AC/online && $(