Skip to content

Commit 88dc8f0

Browse files
authored
Fix v-add-backup-host for sftp servers with different login prompt (hestiacp#2950)
* Fix v-add-backup-host for sftp server that outputs different password prompt On FreeBSD hosted sftp server, the password prompt looks something like this: "Password for: user@host:". This case was not handled so far. * Fix sftp backup procedure for servers with different login prompt
1 parent 80100d7 commit 88dc8f0

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

bin/v-add-backup-host

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,11 @@ sftpc() {
6060
exp_continue
6161
}
6262
63+
-re "Password for (.*)@(.*)" {
64+
send "$password\r"
65+
exp_continue
66+
}
67+
6368
-re "Couldn't|(.*)disconnect|(.*)stalled|(.*)not found" {
6469
set count \$argc
6570
set output "Disconnected."

func/backup.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,11 @@ sftpc() {
208208
send "$PASSWORD\r"
209209
exp_continue
210210
}
211+
212+
-re "Password for (.*)@(.*)" {
213+
send "$PASSWORD\r"
214+
exp_continue
215+
}
211216
212217
-re "Couldn't|(.*)disconnect|(.*)stalled|(.*)not found" {
213218
set count \$argc

0 commit comments

Comments
 (0)