File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -62,7 +62,11 @@ ftp_download() {
6262 if [ -z " $PORT " ]; then
6363 PORT=' 21'
6464 fi
65- ftpc " cd $BPATH " " get $1 "
65+ if [ -z $BPATH ]; then
66+ ftpc " get $1 "
67+ else
68+ ftpc " cd $BPATH " " get $1 "
69+ fi
6670}
6771
6872# sftp command function
@@ -99,8 +103,6 @@ sftpc() {
99103 set arg [lindex \$ argv \$ count]
100104 send "\$ arg\r"
101105 incr count
102- } else {
103- incr count
104106 } else {
105107 send "exit\r"
106108 set output "Disconnected."
@@ -131,7 +133,11 @@ sftp_download() {
131133 PORT=' 22'
132134 fi
133135 cd $BACKUP
134- sftpc " cd $BPATH " " get $1 " > /dev/null 2>&1
136+ if [ -z $BPATH ]; then
137+ sftpc " get $1 " > /dev/null 2>&1
138+ else
139+ sftpc " cd $BPATH " " get $1 " > /dev/null 2>&1
140+ fi
135141
136142}
137143
You can’t perform that action at this time.
0 commit comments