Browse Source

watchcat: fix operation of mode 'always'

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>
lilik-openwrt-22.03
ascob 8 years ago
parent
commit
6065f01ffa
2 changed files with 2 additions and 4 deletions
  1. +1
    -1
      utils/watchcat/Makefile
  2. +1
    -3
      utils/watchcat/files/initd_watchcat

+ 1
- 1
utils/watchcat/Makefile View File

@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=watchcat PKG_NAME:=watchcat
PKG_VERSION:=1 PKG_VERSION:=1
PKG_RELEASE:=5
PKG_RELEASE:=6
PKG_MAINTAINER:=Roger D <rogerdammit@gmail.com> PKG_MAINTAINER:=Roger D <rogerdammit@gmail.com>
PKG_LICENSE:=GPL-2.0 PKG_LICENSE:=GPL-2.0


+ 1
- 3
utils/watchcat/files/initd_watchcat View File

@ -50,7 +50,7 @@ load_watchcat() {
pingperiod="$seconds" pingperiod="$seconds"
if [ "$pingperiod" -ge 0 ] if [ "$pingperiod" -ge 0 ]
then then
[ "$pingperiod" -le "$period" ] \
[ "$pingperiod" -lt "$period" ] \
|| append_string "error" "pingperiod must be less than period" "; " || append_string "error" "pingperiod must be less than period" "; "
else else
append_string "error" 'pingperiod is not a valid time value (ex: "30"; "4m"; "6h"; "2d")' "; " append_string "error" 'pingperiod is not a valid time value (ex: "30"; "4m"; "6h"; "2d")' "; "
@ -59,8 +59,6 @@ load_watchcat() {
pingperiod="$((period/20))" pingperiod="$((period/20))"
fi fi
} }
[ "$pingperiod" -lt "$period" -o "$mode" = "always" ] \
|| append_string "error" "pingperiod is not recognized" "; "
[ "$forcedelay" -ge 0 ] \ [ "$forcedelay" -ge 0 ] \
|| append_string "error" "forcedelay must be a integer greater or equal than 0, where 0 means disabled" "; " || append_string "error" "forcedelay must be a integer greater or equal than 0, where 0 means disabled" "; "


Loading…
Cancel
Save