nopingtime UCI option rationale:
I want relatively fast reaction(i.e. 1m or 2m) for 'no internet' condition,
but i don't want my router to reboot every 1 minute if there is still no
internet after reboot.
initd_watchcat:
* add: nopingtime uci option support
* add: defaults to all non-critical options
* add: log warnings for non-critical errors(when option is missed and
default is applyed)
* fix: error handling and config_get defaults are somtimes in conflict
because of config_get defaults. They are gone now, error handling improved.
* fix: calling watchcat.sh with 'period' mode instead of 'ping'. Typo?
* fix: pingperiod default changed from period/20 to more reasonable period/5
watchcat.sh:
* add: nopingtime uci option support( sleep if uptime < nopingtime )
* remove: [ "$mode" = "allways" ] && mode="always" - not needed, already
done by initd_watchcat in load_watchcat() func
* add: echo 1 > /proc/sys/kernel/sysrq before sysrq-trigger
* refactor: eliminated once used not needed variables, code size reduced.
* PKG_RELEASE bumped up
Signed-off-by: Vasily Trotzky <trotzky.vas@gmail.com>
This patch fixes the watchcat init script in case of mode 'always'.
This mode just needs the config parameters: mode, period and forcedelay.
But a wrong check against the variable pingperiod, needed in the mode 'ping'
prevented mode 'always' to work properly.
Signed-off-by: Tobias Ilte <tobias.ilte@campus.tu-berlin.de>
Note that this implies an API change (allways -> always).
The wrong spelling "allways" is still accepted for backward compatibility.
Signed-off-by: Stefan Weil <sw@weilnetz.de>