Skip to content

Commit 8e3ca01

Browse files
committed
Changing expect to be case insensitive in SFTP
In some cases the sftp command will ask for Password rather than password which is breaking both backups and adding an SFTP host. This change uses the -nocase flag with expect to ensure case is ignored during login and the host can be added and then used.
1 parent e1a66e2 commit 8e3ca01

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

bin/v-add-backup-host

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ sftpc() {
4949
set count 0
5050
spawn /usr/bin/sftp -o StrictHostKeyChecking=no -o Port=$port $user@$host
5151
expect {
52-
"password:" {
52+
-nocase "password:" {
5353
send "$password\r"
5454
exp_continue
5555
}

func/backup.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ sftpc() {
194194
spawn /usr/bin/sftp -o StrictHostKeyChecking=no \
195195
-o Port=$PORT $USERNAME@$HOST
196196
expect {
197-
"password:" {
197+
-nocase "password:" {
198198
send "$PASSWORD\r"
199199
exp_continue
200200
}
@@ -457,4 +457,4 @@ b2_backup() {
457457
b2 delete-file-version $backup > /dev/null 2>&1
458458
done
459459
fi
460-
}
460+
}

0 commit comments

Comments
 (0)