From 47dac3949fa00e495184f06a3b5f61f7016551c7 Mon Sep 17 00:00:00 2001 From: Lightemerald Date: Thu, 18 May 2023 21:47:57 +0200 Subject: [PATCH] Fix send_webhook --- start.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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