set -e; . /usr/local/lib/bash-bear; set +e
+shopt -s nullglob
+
+log() {
+ local off_on f
+ local -a webms
+ off_on=$1
+ webms=(/var/icecast/*.webm)
+ last=$(( ${#webms[@]} -1 ))
+ if (( last >= 0 )); then
+ f=${webms[$last]%.webm}.log
+ else
+ f=/var/icecast/interlude.log
+ fi
+ echo $off_on $EPOCHSECONDS >>$f
+}
+
obs-interlude() {
p=$(cat /p/obs-ws-pass)
if [[ -e /tmp/no-obs-auto-scene-switch ]]; then
# note: get _6 from looking for "parsed" ffmpeg debug output.
zsend -b tcp://127.0.0.1:5557 Parsed_drawbox_6 t 0
zsend -b tcp://127.0.0.1:5557 Parsed_drawtext_7 reinit "text=''"
-
+ log off
else
# I started an attempt to track if I was muted before an interlude,
zsend -b tcp://127.0.0.1:5557 Parsed_drawbox_6 t fill
zsend -b tcp://127.0.0.1:5557 Parsed_drawtext_7 reinit "text='$(date "+%H\:%M %Z") - Be right back'"
touch $f
+ log on
fi
}