File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 3838sftpc () {
3939 expect -f " -" << EOF "$@ "
4040 set count 0
41- spawn /usr/bin/sftp -o StrictHostKeyChecking=no -o \
42- Port=$port $user @$host
41+ spawn " /usr/bin/sftp -o StrictHostKeyChecking=no -o \
42+ Port=$port ' $user @$host '"
4343 expect {
4444 "password:" {
4545 send "$password \r"
9494
9595if [ " $type " != ' local' ]; then
9696 check_args ' 4' " $# " " TYPE HOST USERNAME PASSWORD [PATH] [PORT]"
97- is_format_valid ' host'
97+ is_format_valid ' user ' ' host'
9898 is_password_valid
9999 if [ " $type " = ' sftp' ]; then
100100 which expect > /dev/null 2>&1
101101 check_result $? " expect command not found" $E_NOTEXIST
102102 fi
103+ host " $host " > /dev/null 2>&1
104+ check_result $? " host connection failed" " $E_CONNECT "
103105fi
104106
105107
You can’t perform that action at this time.
0 commit comments