1
0
Fork 0
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:
adrien 2013-09-20 12:27:08 +02:00
parent 560f54c78c
commit 6e3d21e81d

View file

@ -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