mirror of
https://codeberg.org/privacy1st/nix-git
synced 2024-11-21 22:03:19 +01:00
21 lines
474 B
Bash
21 lines
474 B
Bash
#!/usr/bin/env bash
|
|
set -eu -o pipefail
|
|
|
|
# As long as there is the file `stay-alive` at host `yodaNas`,
|
|
# this loop blocks/waits.
|
|
while :; do
|
|
result="$(ssh yodaNas 'ls stay-alive 2>&1')" || :
|
|
case "${result}" in
|
|
*'No such file or directory')
|
|
break
|
|
;;
|
|
'stay-alive')
|
|
printf '%s\n' 'Delaying suspend due to stay-alive file.'
|
|
;;
|
|
*)
|
|
printf '%s\n' 'Delaying suspend due to SSH connectivity problems.'
|
|
;;
|
|
esac
|
|
sleep 10s
|
|
done
|