exit 1
fi
-
-source /a/bin/bash_unpublished/source-state
-
-
+e $new_shell hostname
new_hostname=$($new_shell hostname)
########### end initial processing, begin actually modifying things ##########
fi
btrbk_test="systemctl is-active btrbk.service"
-while [[ $($new_shell $btrbk_test) != inactive ]] || [[ $($old_shell $btrbk_test) != inactive ]]; do
- echo "$0: btrbk is running on new or old host. sleeping for 8 seconds"
- sleep 6
- echo "$0: testing for btrbk activity in 2 seconds"
- sleep 2
+while true; do
+ for shell in "$new_shell" "$old_shell"; do
+ e $shell $btrbk_test
+ status=$($shell $btrbk_test) ||:
+ case $status in
+ inactive|failed) : ;;
+ *)
+ e "btrbk active on shell:$shell, status:$status, sleeping 8 seconds"
+ sleep 8
+ continue
+ ;;
+ esac
+ done
+ break
done
# ensure these are unused before doing anything