Long story short … I was trying to use netwatch to reboot router every time it detects 1.1.1.1 is down (I’m constanlty experiencing LTE interface shutdowns) and I’ve set check time to 5 minutes (at least I thought so … turned out 00:05:00 represents 5 seconds …), but seems like it is starting inital check right upon boot before LTE interface can be properly initialized and guess what … I ended up in a bootloop.
I’ve done the 5 seconds reset button thing and now I have a clean configuration and of course auto backup with all of my old settings and broken netwatch. So my question is - can (auto) backup file (not encrypted) be safely edited in Notepad++ (or in any other way) to disable netwatch on boot - maybe by just deleting one letter from command?
My guess this is not a safe way as I guess file itself has some kind of check upon loading but I’m not too keen to try it myself and have router bricked somehow even it has a secondary boot option.
At least next time I’ll make sure to make a backup before applying changes and try things in safe mode …
Anyway it would be great to have an option to edit configuration upon restore before reboot as some other users already suggested.
Backup, as you’ll quickly find out if you open it in any editor, is binary blob. So not exactly made for editing. But if it’s not encrypted, it’s not completely hopeless. I did a quick test with netwatch set to 1.1.1.1 and it can be found a bit after “netwatch” text as four 0x01 bytes. When changed to 0x7f000001 (127.0.0.1 / localhost), it can be restored and address is changed. Tested with 7.3.1. Not supported or recommended, but if you don’t change anything else, it seems pretty safe. So if you’re feeling brave…
I've taken almost the same path like @Sob except I didn't want to dig into binary encoded IP addresses, so I've added a netwatch item with a benign on-down script {:nothing} and saved a backup; then, I've changed the on-down to another benign value of {:delay 1} (same length), and saved another backup.
Then I've compared the hex dumps of the two backups, and here is the result:
I was expecting to see a difference close to the beginning or to the end of the file, assuming there would be some CRC; the difference in a single byte just a few bytes before the actual change was surprising.
So given that it was a CHR, I've made a snapshot, redacted the delay 1s back to nothing (in both the hex part and the text part) but didn't change the other byte, converted the result back to binary, uploaded it to the CHR, and loaded it using /system/backup/load. Works. So it should be safe to do the same, just replacing the /system reboot by some benign command of same size (just the proper amount of spaces should do), on your Chateau. I assume the worst that can happen is that you'll have to restore the factory defaults againi.
Thank you both guys! I did what Sob mentioned and it worked like a charm! I have no doubt your solution is working too sindy. I was so angry I didn’t do backup before I haven’t thought of doing some hex editing … Anyway I really think this will be a good reference to all other users caught in this situation. Once again thank you both!