+
+cmd=( rsync -aiSAX --chown=root:root --chmod=g-s
+ epanic-clean
+ system-status
+ btrfsmaint
+ mailtest-check
+ dynamic-ip-update /usr/local/bin
+ )
+
+sre() {
+ service=$1
+ if [[ $(systemctl is-active $1.service ||:) != inactive ]]; then
+ # just fire and forget. sometimes a script restart can fail, but then
+ # then auto restart mechanism makes it succeed.
+ m systemctl restart $service ||: &
+ fi
+
+}
+
+while read -r line; do
+ file="${line:12}"
+ #echo debug: file: $file
+ case $file in
+ btrfsmaint)
+ sre btrfsmaintstop
+ ;;
+ mailtest-check)
+ # we stopped removing the dashes in services recently.
+ sre $file
+ ;;
+ *)
+ sre ${file//-/}
+ ;;
+ esac
+done < <("${cmd[@]}")