mirror of
https://github.com/openwrt-xiaomi/xmir-patcher.git
synced 2026-09-22 22:57:55 +03:00
[connect4] Add detect CountryCode
This commit is contained in:
+9
-1
@@ -35,6 +35,14 @@ ret = gw.detect_ssh(verbose = 1, interactive = True)
|
||||
if ret > 0:
|
||||
die(0, "SSH server already installed and running")
|
||||
|
||||
info = gw.get_init_info()
|
||||
if not info or info["code"] != 0:
|
||||
die('Cannot get init_info')
|
||||
|
||||
ccode = info["countrycode"]
|
||||
if ccode == "CN":
|
||||
print('Current CountryCode = CN')
|
||||
|
||||
stok = gw.web_login()
|
||||
|
||||
def exec_cmd(cmd = {}, api = 'misystem/set_sys_time'):
|
||||
@@ -54,7 +62,7 @@ def get_netmode():
|
||||
netmode = get_netmode()
|
||||
if netmode < 0:
|
||||
die('Extension "/api/xqnetwork/get_netmode" not working!')
|
||||
|
||||
|
||||
if netmode != 4:
|
||||
print(f"netmode = {netmode}. Attempting to set netmode to 4 ...")
|
||||
import ssl
|
||||
|
||||
Reference in New Issue
Block a user