Fix the test_server() function in zzz_evobackup.default.sh.j2
continuous-integration/drone/push Build is passing Details

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:
Patrick Marchand 2020-03-26 11:18:55 -04:00
parent d9517e8033
commit 04e1b96833
1 changed files with 2 additions and 1 deletions

View File

@ -1,3 +1,4 @@
#!/bin/sh
# Careful, the zzz_evobackup template was last updated on 2020/03/23
# Script Evobackup client
# See https://gitea.evolix.org/evolix/evobackup
@ -75,7 +76,7 @@ test_server() {
port=$(echo "${item}" | cut -d':' -f2)
# 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
if [ $? = 0 ]; then
# SSH connection is OK