mirror of
https://github.com/nishiki/manage-password.git
synced 2025-02-18 17:10:04 +00:00
fix bug with special char in password, and if the port is nil
This commit is contained in:
parent
560f54c78c
commit
6e3d21e81d
1 changed files with 2 additions and 2 deletions
|
@ -22,7 +22,7 @@ class CliSSH < Cli
|
||||||
|
|
||||||
passwd = r[MPW::PASSWORD]
|
passwd = r[MPW::PASSWORD]
|
||||||
|
|
||||||
if port.empty?
|
if port.nil? || port.empty?
|
||||||
port = 22
|
port = 22
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ class CliSSH < Cli
|
||||||
if passwd.empty?
|
if passwd.empty?
|
||||||
system("ssh #{login}@#{server} -p #{port}")
|
system("ssh #{login}@#{server} -p #{port}")
|
||||||
else
|
else
|
||||||
system("sshpass -p #{passwd} ssh #{login}@#{server} -p #{port}")
|
system("sshpass -p '#{passwd}' ssh #{login}@#{server} -p #{port}")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue