mirror of
https://github.com/nishiki/manage-password.git
synced 2024-11-23 05:47:53 +00:00
fix mpw-ssh
This commit is contained in:
parent
7d71dded68
commit
eb0847b16b
4 changed files with 12 additions and 8 deletions
|
@ -11,4 +11,8 @@ This program work with ruby >= 1.9
|
|||
* install ruby and rubygems on your computer
|
||||
* gem install mpw
|
||||
|
||||
If you want use mpw-ssh, you must install sshpass
|
||||
|
||||
# How to use
|
||||
|
||||
mpw -h
|
||||
|
|
2
VERSION
2
VERSION
|
@ -1 +1 @@
|
|||
2.0.0
|
||||
2.0.1
|
||||
|
|
|
@ -12,15 +12,15 @@ class CliSSH < Cli
|
|||
# Connect to SSH
|
||||
# args: search -> string to search
|
||||
def ssh(search)
|
||||
result = @mpw.search(search, nil, 'ssh')
|
||||
result = @mpw.list(search: search, protocol: 'ssh')
|
||||
|
||||
if result.length > 0
|
||||
result.each do |r|
|
||||
server = @server.nil? ? r[:host] : @server
|
||||
port = @port.nil? ? r[:port] : @port
|
||||
login = @login.nil? ? r[:login] : @login
|
||||
result.each do |item|
|
||||
server = @server.nil? ? item.host : @server
|
||||
port = @port.nil? ? item.port : @port
|
||||
login = @login.nil? ? item.user : @login
|
||||
|
||||
passwd = r[:password]
|
||||
passwd = item.password
|
||||
|
||||
if port.nil? and port.empty?
|
||||
port = 22
|
||||
|
|
|
@ -13,7 +13,7 @@ Gem::Specification.new do |spec|
|
|||
spec.license = 'GPL'
|
||||
|
||||
spec.files = `git ls-files -z`.split("\x0")
|
||||
spec.executables = ['mpw', 'mpw-server']
|
||||
spec.executables = ['mpw', 'mpw-server', 'mpw-ssh']
|
||||
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
||||
spec.require_paths = ['lib']
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue