connect: Add possibility set web password in command line

Example: run.bat connect6.py 12345678
This commit is contained in:
remittor
2025-03-04 19:38:39 +03:00
parent 5b7d2962ed
commit 71ed2e9808
3 changed files with 14 additions and 2 deletions
+7 -1
View File
@@ -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"]