We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4aeec46 commit b57c4dcCopy full SHA for b57c4dc
1 file changed
bin/v-restore-user
@@ -62,7 +62,11 @@ ftp_download() {
62
if [ -z "$PORT" ]; then
63
PORT='21'
64
fi
65
- ftpc "cd $BPATH" "get $1"
+ if [ -z $BPATH ]; then
66
+ ftpc "get $1"
67
+ else
68
+ ftpc "cd $BPATH" "get $1"
69
+ fi
70
}
71
72
# sftp command function
@@ -99,8 +103,6 @@ sftpc() {
99
103
set arg [lindex \$argv \$count]
100
104
send "\$arg\r"
101
105
incr count
102
- } else {
- incr count
106
} else {
107
send "exit\r"
108
set output "Disconnected."
@@ -131,7 +133,11 @@ sftp_download() {
131
133
PORT='22'
132
134
135
cd $BACKUP
- sftpc "cd $BPATH" "get $1" > /dev/null 2>&1
136
137
+ sftpc "get $1" > /dev/null 2>&1
138
139
+ sftpc "cd $BPATH" "get $1" > /dev/null 2>&1
140
141
142
143
0 commit comments