mirror of
https://codeberg.org/privacy1st/nix-git
synced 2024-11-21 22:03:19 +01:00
20 lines
449 B
Bash
20 lines
449 B
Bash
|
#!/usr/bin/env bash
|
||
|
|
||
|
# 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
|