support for restarting a network interface instead of rebooting the router
ping via a specific interface and restart that interface if the ping fails
support for specifying ping packet size
included a ModemManager-specific path of action
general refactor of the code: renaming variable names, aiming for style consistency
supports backward-compatibility with the old service type names: always, ping
The code needs another quick tidy up, and the commits need to be redone in order to make this modular and more easily acceptable/revertable, which I will do. Here is my plan for that:
A commit for each of the following:
the first refactor
the ping packet size feature
the restart_iface feature
the modemmanager specific features
I wanted to see if I should change the priorities a bit based on community feedback before starting the MR.
Should I make it so any service can be restarted, instead of just ModemManager?
There have been some changes to luci-app-watchcat and watchcat; namely a rewrite in JavaScript, and moving Watchcat into its own /etc/config/watchcat file, respectively. Testing is welcome. At the moment there is a call for suggestions on how to support migration from the old system.@watchcat[n] UCI configuration to the new location via a UCI-defaults shell script. If anyone has any suggestions, feedback or code contributions feel free to jump into the conversation.
suggestion
on the Mode: Restart Interface
to check if the wireless is in AP or STA mode,
So if we change the wireless interface from STA to AP and we forget to set the watchcat, the watchcat will automatically deactivate the interface restart mode.
I'm having trouble getting the current version 1-12 to work with mwan3 on 21.02. I have two wan connections. With version 1-7 on 19.07, as long as one of the two wan connections was up it wouldn't reboot. With v1-12 if the main wan connection goes down it will reboot even if the wanb connection is still up. Maybe I'm doing something wrong?
One suggestion:
there is already an app luci-app-commands in which the user can define custom commands. It would be nice if you can incooperate luci-app-watchcat to trigger a custom command from luci-app-commands
Yes I had that idea earlier, just haven't had time to implement it yet. You can already accomplish the same thing by modifying the source code of this package