connect: Add possibility set web password in command line

Example: run.bat connect6.py 12345678
pull/86/head
remittor 8 months ago
parent 5b7d2962ed
commit 71ed2e9808

@ -17,11 +17,17 @@ import json
import xmir_base
from gateway import *
die_if_sshOk = True
web_password = True
if len(sys.argv) > 1 and sys.argv[0].endswith('connect5.py'):
if sys.argv[1]:
web_password = sys.argv[1]
die_if_sshOk = False
try:
gw = inited_gw
except NameError:
gw = create_gateway(die_if_sshOk = True)
gw = create_gateway(die_if_sshOk = die_if_sshOk, web_login = web_password)
ccode = gw.device_info["countrycode"]

@ -9,11 +9,15 @@ import requests
import xmir_base
from gateway import *
web_password = True
if len(sys.argv) > 1 and sys.argv[0].endswith('connect6.py'):
if sys.argv[1]:
web_password = sys.argv[1]
try:
gw = inited_gw
except NameError:
gw = create_gateway(die_if_sshOk = False)
gw = create_gateway(die_if_sshOk = False, web_login = web_password)
def exploit_1(cmd, api = 'API/misystem/arn_switch'):

@ -1010,6 +1010,8 @@ def create_gateway(timeout = 4, die_if_sshOk = True, die_if_ftpOk = True, web_lo
ccode = gw.device_info["countrycode"]
print(f'CountryCode = {ccode}')
if web_login:
if isinstance(web_login, str):
gw.webpassword = web_login
gw.web_login()
return gw

Loading…
Cancel
Save