# 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
# 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*
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
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
}
if [[ -e /sys/class/power_supply/AC/online && $(</sys/class/power_supply/AC/online) == 0 ]]; then
power=false
fi
- wait=15
if $power; then
- if (( loop_count % 10 == 0 )); then
- if [[ -r /sys/class/power_supply/BAT0/capacity ]]; then
- bat=$(cat /sys/class/power_supply/BAT0/capacity)
- else
- bat=100
- fi
- case $bat in
- 100|9?)
- :
- bitcoinon &
- ;;
- esac
- fi
+ wait=15
else
- bitcoinoff
wait=60
fi