-kd_spread=false
-# set default targets
-if [[ ! -v targets && ! $source ]]; then
- if $cron; then
- if [[ $HOSTNAME != "$MAIL_HOST" ]]; then
- if $kd_spread_maybe && [[ $HOSTNAME == kd && $MAIL_HOST == x3 ]]; then
- if ping -q -c1 -w1 x3.office.fsf.org &>/dev/null; then
- work_host=x3.office.fsf.org
- elif ping -q -c1 -w1 x3wg.b8.nz &>/dev/null; then
- work_host=x3wg.b8.nz
- fi
- if [[ $work_host ]]; then
- source_state="$(ssh $work_host cat /a/bin/bash_unpublished/source-state)"
- eval "$source_state"
- if [[ $MAIL_HOST == x3 ]]; then
- kd_spread=true
- else
- # x3 was the mail host, but it moved to some other machine
- # without updating us yet.
- echo "MAIL_HOST=$MAIL_HOST, nothing to do"
- mexit 0
- fi
- else
- echo "MAIL_HOST=$MAIL_HOST, nothing to do"
- mexit 0
- fi
- else
- echo "MAIL_HOST=$MAIL_HOST, nothing to do"
- mexit 0
- fi
- fi
- fi
-
- at_work=false
- at_home=false
-
- case $HOSTNAME in
- kw|kd|frodo|x2|x3|sy) : ;;
- *)
- die "error: no default targets for this host, use -t"
- ;;
- esac