Browse Source

bin/v-add-backup-host: report inability to connect via sftp (#4119)

* bin/v-add-backup-host: report inability to connect via sftp

Previously it silently failed, see
https://forum.hestiacp.com/t/allow-manual-backups-when-backup-system-is-disabled/10690/10

* Update v-add-backup-host

---------

Co-authored-by: Jaap Marcus <9754650+jaapmarcus@users.noreply.github.com>
Janek 2 years ago
parent
commit
79b8442f1f
1 changed files with 2 additions and 1 deletions
  1. 2 1
      bin/v-add-backup-host

+ 2 - 1
bin/v-add-backup-host

@@ -242,10 +242,11 @@ if [ "$type" = 'sftp' ]; then
 		fi
 	fi
 	rc=$?
-	if [[ "$rc" != 0 ]]; then
+	if [[ "$rc" -ne 0 ]]; then
 		case $rc in
 			$E_CONNECT) echo "Error: can't login to sftp $user@$host" ;;
 			$E_FTP) echo "Error: can't create temp folder on the sftp host" ;;
+			*) echo "Error Unable to connect via sftp.";;
 		esac
 		log_event "$rc" "$ARGUMENTS"
 		exit "$rc"