Show More
@@ -208,9 +208,13 b" def openssh_tunnel(lport, rport, server, remoteip='127.0.0.1', keyfile=None, pas" | |||||
208 | ssh="ssh " |
|
208 | ssh="ssh " | |
209 | if keyfile: |
|
209 | if keyfile: | |
210 | ssh += "-i " + keyfile |
|
210 | ssh += "-i " + keyfile | |
211 | username, server, port = _split_server(server) |
|
211 | ||
212 | cmd = "%s -p %s -f -L 127.0.0.1:%i:%s:%i %s@%s sleep %i" % ( |
|
212 | if ':' in server: | |
213 | ssh, port, lport, remoteip, rport, username, server, timeout) |
|
213 | server, port = server.split(':') | |
|
214 | ssh += " -p %s" % port | |||
|
215 | ||||
|
216 | cmd = "%s -f -L 127.0.0.1:%i:%s:%i %s sleep %i" % ( | |||
|
217 | ssh, lport, remoteip, rport, server, timeout) | |||
214 | tunnel = pexpect.spawn(cmd) |
|
218 | tunnel = pexpect.spawn(cmd) | |
215 | failed = False |
|
219 | failed = False | |
216 | while True: |
|
220 | while True: |
General Comments 0
You need to be logged in to leave comments.
Login now