Add optin for failcommand

This commit is contained in:
Fliegerjohn 2023-08-22 18:13:16 +02:00
parent 6ad719ded0
commit 0542bf16e7

View file

@ -5,8 +5,8 @@
# #
# Testsites should return HTTP-Code "204" # Testsites should return HTTP-Code "204"
testsite1=https://datenkastl.de/.connectivity-check testsite1="https://datenkastl.de/.connectivity-check"
testsite2=http://captiveportal.kuketz.de testsite2="http://captiveportal.kuketz.de"
# Testdomains for ping # Testdomains for ping
testdomain1=datenkastl.de testdomain1=datenkastl.de
@ -16,6 +16,9 @@ testdomain2=metager.de
curlbin=`type -tp curl` curlbin=`type -tp curl`
pingbin=`type -tp ping` pingbin=`type -tp ping`
# Command in case of connection fail.
failcommand="echo Exit without action"
# #
## Functions ## Functions
# #
@ -36,6 +39,8 @@ testwithcurl() {
else else
echo "The network is down." echo "The network is down."
$failcommand
fi fi
fi fi
} }
@ -51,6 +56,7 @@ testwithping() {
else else
echo "The network is down." echo "The network is down."
$failcommand
fi fi
} }