watchcat: add nopingtime option + refactoring 13940/head
authorVasily Trotzky <trotzky.vas@gmail.com>
Thu, 19 Nov 2020 11:50:39 +0000 (14:50 +0300)
committerVasily Trotzky <trotzky.vas@gmail.com>
Thu, 19 Nov 2020 11:50:39 +0000 (14:50 +0300)
commit56b842f0b7a7c0e0d8d962ff4a6f900005e67056
treefe1c2826112139439a2b8fb365e0df152ae4f41f
parent316f87022847e3cde1d0ef34cf4e9322a70e287a
watchcat: add nopingtime option + refactoring

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>
utils/watchcat/Makefile
utils/watchcat/files/initd_watchcat
utils/watchcat/files/watchcat.sh