From 0542bf16e73754e5735c6d9c2f3bb7704c5d11dd Mon Sep 17 00:00:00 2001 From: fliegerjohn Date: Tue, 22 Aug 2023 18:13:16 +0200 Subject: [PATCH] Add optin for failcommand --- checkconnection.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/checkconnection.sh b/checkconnection.sh index 5028486..5eb4a36 100755 --- a/checkconnection.sh +++ b/checkconnection.sh @@ -5,8 +5,8 @@ # # Testsites should return HTTP-Code "204" -testsite1=https://datenkastl.de/.connectivity-check -testsite2=http://captiveportal.kuketz.de +testsite1="https://datenkastl.de/.connectivity-check" +testsite2="http://captiveportal.kuketz.de" # Testdomains for ping testdomain1=datenkastl.de @@ -16,6 +16,9 @@ testdomain2=metager.de curlbin=`type -tp curl` pingbin=`type -tp ping` +# Command in case of connection fail. +failcommand="echo Exit without action" + # ## Functions # @@ -36,6 +39,8 @@ testwithcurl() { else echo "The network is down." + $failcommand + fi fi } @@ -51,6 +56,7 @@ testwithping() { else echo "The network is down." + $failcommand fi }