1
0
Fork 0
mirror of https://github.com/nishiki/manage-password.git synced 2025-05-16 13:54:01 +00:00

add share_keys

This commit is contained in:
nishiki 2014-02-02 17:34:05 +01:00
parent 076aedeb3c
commit bed8cbb8b6
4 changed files with 22 additions and 10 deletions
MPW/Sync

View file

@ -31,11 +31,13 @@ module MPW
# suffix -> the suffix file
# @rtrn: false if the connection fail
def connect(host, user, password, path, port=nil)
@host = host
@port = !port.instance_of?(Integer) ? 2201 : port
@gpg_key = user
@password = password
@suffix = path
TCPSocket.new(host, port.to_i) do
TCPSocket.open(@host, @port) do
@enable = true
end
rescue Exception => e
@ -53,7 +55,8 @@ module MPW
return nil
end
TCPSocket.new(host, port.to_i) do |socket|
msg = nil
TCPSocket.open(@host, @port) do |socket|
send_msg = {:action => 'get',
:gpg_key => @gpg_key,
:password => @password,
@ -95,7 +98,8 @@ module MPW
return true
end
TCPSocket.new(host, port.to_i) do |socket|
msg = nil
TCPSocket.open(@host, @port) do |socket|
send_msg = {:action => 'update',
:gpg_key => @gpg_key,
:password => @password,