diff options
author | Helmut Grohne <helmut@subdivi.de> | 2022-12-31 07:34:10 +0100 |
---|---|---|
committer | Helmut Grohne <helmut@subdivi.de> | 2022-12-31 07:37:06 +0100 |
commit | 45a8428a30c2aebeb5163913c8167b318ff65c81 (patch) | |
tree | 96c5acba0384e030908f35f400baa69dc562f961 /tests/try-ssh.sh | |
parent | b7af04e9262142e953e487e75d91b610f1001ab4 (diff) | |
download | debvm-45a8428a30c2aebeb5163913c8167b318ff65c81.tar.gz |
tests: rework common code
Turn try-ssh.sh script into a shell function library.
Diffstat (limited to 'tests/try-ssh.sh')
-rwxr-xr-x | tests/try-ssh.sh | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/tests/try-ssh.sh b/tests/try-ssh.sh deleted file mode 100755 index 109299b..0000000 --- a/tests/try-ssh.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh - -# shellcheck disable=SC2086 - -if test "$#" -ne 2; then - echo "$(basename "$0") takes two positional arguments. options/host and command" 1>&2 - exit 1 -fi - -timeout=5 -ts=$(sleepenh 0 || [ $? -eq 1 ]) -for i in $(seq 30); do - rv=0 - ssh $1 echo success || rv=$? - test $rv -eq 0 && break - ts=$(sleepenh "$ts" "$timeout" || [ $? -eq 1 ]); - if test "$i" -eq 30; then - echo "timeout reached" >&2 - exit 1 - fi -done -ssh $1 $2 |