mirror of
https://github.com/nishiki/manage-password.git
synced 2024-11-27 07:33:05 +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]
|
||||
|
||||
if port.empty?
|
||||
if port.nil? || port.empty?
|
||||
port = 22
|
||||
end
|
||||
|
||||
|
@ -30,7 +30,7 @@ class CliSSH < Cli
|
|||
if passwd.empty?
|
||||
system("ssh #{login}@#{server} -p #{port}")
|
||||
else
|
||||
system("sshpass -p #{passwd} ssh #{login}@#{server} -p #{port}")
|
||||
system("sshpass -p '#{passwd}' ssh #{login}@#{server} -p #{port}")
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue