--- a/watchcat/files/watchcat.init +++ b/watchcat/files/watchcat.init @@ -32,6 +32,8 @@ time_to_seconds() { config_watchcat() { # Read config + config_get_bool enabled "$1" enabled 0 + [ "$enabled" = "1" ] || { echo "Watcat $1 not enabled."; return 1; } config_get period "$1" period "120" config_get mode "$1" mode "ping_reboot" config_get pinghosts "$1" pinghosts "8.8.8.8" --- a/watchcat/files/watchcat.config +++ b/watchcat/files/watchcat.config @@ -1,5 +1,5 @@ config watchcat option period '6h' option mode 'ping_reboot' - option pinghosts '8.8.8.8' + option pinghosts '223.5.5.5' option forcedelay '30' --- a/luci-app-watchcat/htdocs/luci-static/resources/view/watchcat.js +++ b/luci-app-watchcat/htdocs/luci-static/resources/view/watchcat.js @@ -18,6 +18,9 @@ return view.extend({ s.tab('general', _('General Settings')); + o = s.taboption('general', form.Flag, 'enabled', _('Enabled')); + o.rmempty = false; + o = s.taboption('general', form.ListValue, 'mode', _('Mode'), _("Ping Reboot: Reboot this device if a ping to a specified host fails for a specified duration of time.
\ @@ -51,7 +51,7 @@ return view.extend({ o = s.taboption('general', form.DynamicList, 'pinghosts', _('Hosts To Check'), _(`IP addresses or hostnames to ping.`)); o.datatype = 'host'; - o.default = ['8.8.8.8', '1.1.1.1']; + o.default = ['223.5.5.5', '8.8.8.8', '1.1.1.1']; o.depends({ mode: "ping_reboot" }); o.depends({ mode: "restart_iface" }); o.depends({ mode: "run_script" });