diff --git a/start.sh b/start.sh index a8924a8..efafc37 100644 --- a/start.sh +++ b/start.sh @@ -16,6 +16,11 @@ then exit fi +function send_webhook() { + local message="$1" + curl -i -H "Accept: application/json" -H "Content-Type:application/json" -X POST --data "{\"content\": \"$message\"}" "$webhook" +} + vpns=$(nmcli connection show | grep vpn | awk '{print $1}') host=$(hostname -f) @@ -154,9 +159,4 @@ do send_webhook "ERROR: VPN name is empty" fi fi -done - -send_webhook() { - local message="$1" - curl -i -H "Accept: application/json" -H "Content-Type:application/json" -X POST --data "{\"content\": \"$message\"}" "$webhook" -} +done \ No newline at end of file