forked from evolix/ansible-roles
Fix the test_server() function in zzz_evobackup.default.sh.j2
The script was using the wrong ssh key to test the connection, thus reporting a failed connection even if the rest was okay.
This commit is contained in:
parent
d9517e8033
commit
04e1b96833
|
@ -1,3 +1,4 @@
|
||||||
|
#!/bin/sh
|
||||||
# Careful, the zzz_evobackup template was last updated on 2020/03/23
|
# Careful, the zzz_evobackup template was last updated on 2020/03/23
|
||||||
# Script Evobackup client
|
# Script Evobackup client
|
||||||
# See https://gitea.evolix.org/evolix/evobackup
|
# See https://gitea.evolix.org/evolix/evobackup
|
||||||
|
@ -75,7 +76,7 @@ test_server() {
|
||||||
port=$(echo "${item}" | cut -d':' -f2)
|
port=$(echo "${item}" | cut -d':' -f2)
|
||||||
|
|
||||||
# Test if the server is accepting connections
|
# Test if the server is accepting connections
|
||||||
ssh -q -o "ConnectTimeout ${SSH_CONNECT_TIMEOUT}" "${host}" -p "${port}" -t "exit"
|
ssh -q -o "ConnectTimeout ${SSH_CONNECT_TIMEOUT}" -i /root/.ssh/evobackup_id "${host}" -p "${port}" -t "exit"
|
||||||
# shellcheck disable=SC2181
|
# shellcheck disable=SC2181
|
||||||
if [ $? = 0 ]; then
|
if [ $? = 0 ]; then
|
||||||
# SSH connection is OK
|
# SSH connection is OK
|
||||||
|
|
Loading…
Reference in a new issue