4 # setup things which involve being the primary host or not
6 source /usr
/local
/lib
/err
9 m
() { printf "$pre %s\n" "$*"; "$@"; }
10 e
() { printf "$pre %s\n" "$*"; }
11 err
() { echo "[$(date +'%Y-%m-%d %H:%M:%S%z')]: $0: $*" >&2; }
14 if [[ $EUID == 0 && ! $SUDO_USER ]]; then
15 err
"requires running as nonroot or sudo"
21 m
sed -ri "s/MAIL_HOST=.*/MAIL_HOST=$new_host/" /a
/bin
/bash_unpublished
/source-state
22 source /a
/bin
/bash_unpublished
/source-state
25 if [[ $HOSTNAME == "$MAIL_HOST" ]]; then
26 # arbtt disabled for now
27 #DISPLAY=:0 arbtt-capture --sample-rate=10 &
28 m sudo systemctl start rss2email.timer
29 m sudo systemctl
enable rss2email.timer
30 m sudo systemctl start btrbk.timer
31 m sudo systemctl
enable btrbk.timer
34 m sudo systemctl stop rss2email.timer
35 m sudo systemctl stop rss2email.service
36 m sudo systemctl disable rss2email.timer
37 # arbtt disabled for now
38 # for ((i=0; i<10; i++)); do
39 # killall arbtt-capture || break
41 # if [[ $i == 9 ]]; then