mirror of
https://github.com/openwrt-xiaomi/xmir-patcher.git
synced 2026-09-22 22:57:55 +03:00
install_fw: Add catching ssh2.SocketRecvError on reboot
This commit is contained in:
+7
-2
@@ -1112,9 +1112,14 @@ class XqFlash():
|
||||
gw.run_cmd("sync ; umount -a", timeout = 5)
|
||||
print("Please, reboot router!")
|
||||
else:
|
||||
import ssh2
|
||||
print('Send command "reboot" via SSH/Telnet ...')
|
||||
gw.run_cmd("reboot -f", die_on_error = False)
|
||||
print("Forced REBOOT activated!")
|
||||
try:
|
||||
gw.run_cmd("reboot -f", die_on_error = False)
|
||||
print("Forced REBOOT activated!")
|
||||
except ssh2.exceptions.SocketRecvError as e:
|
||||
print("Forced REBOOT Activated!")
|
||||
pass
|
||||
|
||||
def flash_data_to_mtd(self, img_name, img: Image, timeout, check = True):
|
||||
print(f'Writing {img_name} image to addr 0x{img.addr:08X} ...')
|
||||
|
||||
Reference in New Issue
Block a user