Remove debug echo statements from SSH response checks in start_backup.sh

This commit is contained in:
gyurix
2025-08-27 11:10:23 +02:00
parent c3df1c8194
commit 7f57b16a58

View File

@@ -58,14 +58,14 @@ fi
for BACKUP in $( echo -n $SSH_HOST) ; do
# check backup client availability
RESPONSE=$(ssh -o StrictHostKeyChecking=no -o PreferredAuthentications=password -o ConnectTimeout=5 -o BatchMode=yes -p $SSH_PORT $SSH_USER@$BACKUP /bin/true 2>&1)
echo "RESPONSE: $RESPONSE"
if [ "$(echo $RESPONSE | grep -o resolve)" != "" ]; then
echo "Expected backup client $BACKUP on port $SSH_PORT currently not available"
continue
fi
# set backup client IP addresses and ports
RESPONSE=$(ssh -o StrictHostKeyChecking=no -o PreferredAuthentications=password -o ConnectTimeout=5 -o BatchMode=yes -p $SSH_PORT $SSH_USER@$BACKUP /bin/true 2>&1)
echo "RESPONSE: $RESPONSE"
if [ "$(echo $RESPONSE | grep -o password)" != "" ]; then
echo "SSH password authentication enabled"
sshpass -p "$SSH_PASSWORD" ssh -p $SSH_PORT -i $SSH_DIR/id_$key_type $SSH_USER@$BACKUP "mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys" < $SSH_DIR/id_$key_type.pub
@@ -73,7 +73,7 @@ for BACKUP in $( echo -n $SSH_HOST) ; do
sleep 2
fi
RESPONSE=$(ssh -o StrictHostKeyChecking=no -o PreferredAuthentications=password -o ConnectTimeout=5 -o BatchMode=yes -p $SSH_PORT $SSH_USER@$BACKUP /bin/true 2>&1)
echo "RESPONSE: $RESPONSE"
if [ "$(echo $RESPONSE | grep -o password)" == "" ]; then
echo "SSH password authentication is disabled on the server."