watchcat: fix operation of mode 'always' 3092/head
authorascob <menosmalo753@gmail.com>
Wed, 24 Aug 2016 13:47:58 +0000 (15:47 +0200)
committerascob <menosmalo753@gmail.com>
Wed, 24 Aug 2016 13:47:58 +0000 (15:47 +0200)
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>
utils/watchcat/Makefile
utils/watchcat/files/initd_watchcat

index 9160cff0afe8f36fe5eafb86513ef2b887e8bbe2..d25c0c2a4d14b38ae54f9f3bcb72474e97164d32 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=watchcat
 PKG_VERSION:=1
-PKG_RELEASE:=5
+PKG_RELEASE:=6
 
 PKG_MAINTAINER:=Roger D <rogerdammit@gmail.com>
 PKG_LICENSE:=GPL-2.0
index bc2a6bde0a18479fcb795d5905b2a94f76e48df8..d6f954e9e5617098904b9bd06e68c14b04e594bb 100644 (file)
@@ -50,7 +50,7 @@ load_watchcat() {
                        pingperiod="$seconds"
                        if [ "$pingperiod" -ge 0 ]
                        then
-                               [ "$pingperiod" -le "$period" ] \
+                               [ "$pingperiod" -lt "$period" ] \
                                        || append_string "error" "pingperiod must be less than period" "; "
                        else
                                append_string "error" 'pingperiod is not a valid time value (ex: "30"; "4m"; "6h"; "2d")' "; "
@@ -59,8 +59,6 @@ load_watchcat() {
                        pingperiod="$((period/20))"
                fi
        }
-       [ "$pingperiod" -lt "$period" -o "$mode" = "always" ] \
-               || append_string "error" "pingperiod is not recognized" "; "
        [ "$forcedelay" -ge 0 ] \
                || append_string "error" "forcedelay must be a integer greater or equal than 0, where 0 means disabled" "; "