Browse Source

fix validating data

sshtunnel
Christian Rotzoll 6 years ago
parent
commit
65bf544883
  1. 11
      home.admin/config.scripts/internet.sshtunnel.py

11
home.admin/config.scripts/internet.sshtunnel.py

@ -45,17 +45,18 @@ if sys.argv[1] == "on":
# sys.exit(1)
# check server address
ssh_server = sys.argv[2]
if ssh_server.count("@") != 1:
if len(sys.argv) < 3:
print("[USER]@[SERVER] missing - use 'internet.sshtunnel.py -h' for help")
sys.exit(1)
if sys.argv[2].count("@") != 1:
print("[USER]@[SERVER] wrong - use 'internet.sshtunnel.py -h' for help")
sys.exit(1)
ssh_server = sys.argv[2]
# check minimal forwardings
# genenate additional parameter for autossh (forwarding ports)
if len(sys.argv) < 4:
print("[INTERNAL-PORT]:[EXTERNAL-PORT] missing - run 'internet.sshtunnel.py off' first")
sys.exit(1)
# genenate additional parameter for autossh (forwarding ports)
additional_parameters=""
i = 3
while i < len(sys.argv):

Loading…
Cancel
Save