From 28bd88fd90570f3e400de5e54ca7ab2432e3826b Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Wed, 29 Sep 2010 20:37:46 +0200 Subject: watchdog.sh: misc changes Signed-off-by: Florian Pritz --- watchdog.sh | 43 +++++++++++++++++++++++++++++-------------- 1 file changed, 29 insertions(+), 14 deletions(-) (limited to 'watchdog.sh') diff --git a/watchdog.sh b/watchdog.sh index 0101b26..ae5e482 100755 --- a/watchdog.sh +++ b/watchdog.sh @@ -17,7 +17,7 @@ #-------------------------- CONFIGURATION -----------------------------# # Time to wait between 2 checks; Shouldn't be lower than 10 as that # could cause overlap with the timeouts -WAIT=60 +WAIT=30 # Take action after x faild checks MAX_FAIL=2 @@ -38,6 +38,8 @@ EXIT_FAILURE=1 EXIT_ERROR=2 EXIT_BUG=10 +DEBUG=0 + # Colors for output red='\e[0;31m' RED='\e[1;31m' @@ -50,16 +52,23 @@ CYAN='\e[1;36m' NC='\e[0m' function usage { - echo -e "${blue}Usage:${NC} ${SCRIPTNAME} [OPTIONS] [ ]" >&2 + echo -e "${blue}Usage:${NC} ${SCRIPTNAME} [OPTIONS]" >&2 echo -e "Possible service types: http, ping (default)" echo -e "Options:" >&2 echo -e "-h this help" >&2 + echo -e "-d debug output" >&2 echo -e "-f loads IP list from a file" >&2 echo -e "-t