mirror of
https://github.com/openwrt/packages.git
synced 2025-12-10 12:41:22 +00:00
watchcat: fix argument handling and allow multiple ping hosts
The backend now correctly supports multiple IP addresses and avoids argument shifting when mmifacename is empty. Signed-off-by: Ivan Diaz <diaz.it@icloud.com>
This commit is contained in:
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=watchcat
|
||||
PKG_VERSION:=1
|
||||
PKG_RELEASE:=17
|
||||
PKG_RELEASE:=18
|
||||
|
||||
PKG_MAINTAINER:=Roger D <rogerdammit@gmail.com>
|
||||
PKG_LICENSE:=GPL-2.0
|
||||
|
||||
@@ -38,8 +38,8 @@ config_watchcat() {
|
||||
config_get pingperiod "$1" pingperiod "60"
|
||||
config_get forcedelay "$1" forcedelay "60"
|
||||
config_get pingsize "$1" pingsize "standard"
|
||||
config_get interface "$1" interface
|
||||
config_get mmifacename "$1" mmifacename
|
||||
config_get interface "$1" interface # CHEK only if need a default?
|
||||
config_get mmifacename "$1" mmifacename # FIX HERE need a default?
|
||||
config_get_bool unlockbands "$1" unlockbands "0"
|
||||
config_get addressfamily "$1" addressfamily "any"
|
||||
config_get script "$1" script
|
||||
@@ -104,19 +104,19 @@ config_watchcat() {
|
||||
;;
|
||||
ping_reboot)
|
||||
procd_open_instance "watchcat_${1}"
|
||||
procd_set_param command /usr/bin/watchcat.sh "ping_reboot" "$period" "$forcedelay" "$pinghosts" "$pingperiod" "$pingsize" "$addressfamily"
|
||||
procd_set_param command /usr/bin/watchcat.sh "ping_reboot" "$period" "$forcedelay" \"$pinghosts\" "$pingperiod" "$pingsize" "$addressfamily"
|
||||
procd_set_param respawn "${respawn_threshold:-3600}" "${respawn_timeout:-5}" "${respawn_retry:-5}"
|
||||
procd_close_instance
|
||||
;;
|
||||
restart_iface)
|
||||
procd_open_instance "watchcat_${1}"
|
||||
procd_set_param command /usr/bin/watchcat.sh "restart_iface" "$period" "$pinghosts" "$pingperiod" "$pingsize" "$interface" "$mmifacename" "$unlockbands" "$addressfamily"
|
||||
procd_set_param command /usr/bin/watchcat.sh "restart_iface" "$period" \"$pinghosts\" "$pingperiod" "$pingsize" "$interface" "$mmifacename" "$unlockbands" "$addressfamily"
|
||||
procd_set_param respawn "${respawn_threshold:-3600}" "${respawn_timeout:-5}" "${respawn_retry:-5}"
|
||||
procd_close_instance
|
||||
;;
|
||||
run_script)
|
||||
procd_open_instance "watchcat_${1}"
|
||||
procd_set_param command /usr/bin/watchcat.sh "run_script" "$period" "$pinghosts" "$pingperiod" "$pingsize" "$interface" "$addressfamily" "$script"
|
||||
procd_set_param command /usr/bin/watchcat.sh "run_script" "$period" \"$pinghosts\" "$pingperiod" "$pingsize" "$interface" "$addressfamily" "$script"
|
||||
procd_set_param respawn "${respawn_threshold:-3600}" "${respawn_timeout:-5}" "${respawn_retry:-5}"
|
||||
procd_close_instance
|
||||
;;
|
||||
|
||||
Reference in New Issue
Block a user