mirror of
https://github.com/myvesta/vesta
synced 2025-08-14 18:49:21 -07:00
Merge pull request #21 from serghey-rodin/master
updates from official vesta
This commit is contained in:
commit
c082c61de9
2 changed files with 60 additions and 65 deletions
|
@ -38,8 +38,8 @@ EOF
|
|||
sftpc() {
|
||||
expect -f "-" <<EOF "$@"
|
||||
set count 0
|
||||
spawn /usr/bin/sftp -o StrictHostKeyChecking=no -o \
|
||||
Port=$port $user@$host
|
||||
spawn "/usr/bin/sftp -o StrictHostKeyChecking=no -o \
|
||||
Port=$port '$user@$host'"
|
||||
expect {
|
||||
"password:" {
|
||||
send "$password\r"
|
||||
|
@ -94,12 +94,14 @@ EOF
|
|||
|
||||
if [ "$type" != 'local' ];then
|
||||
check_args '4' "$#" "TYPE HOST USERNAME PASSWORD [PATH] [PORT]"
|
||||
is_format_valid 'host'
|
||||
is_format_valid 'user' 'host' 'path' 'port'
|
||||
is_password_valid
|
||||
if [ "$type" = 'sftp' ]; then
|
||||
which expect >/dev/null 2>&1
|
||||
check_result $? "expect command not found" $E_NOTEXIST
|
||||
fi
|
||||
host "$host" >/dev/null 2>&1
|
||||
check_result $? "host connection failed" "$E_CONNECT"
|
||||
fi
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue