Added more logs to webhook and made curl silent to more lisible terminal output.

This commit is contained in:
2023-05-18 21:55:23 +02:00
parent a90b240fe1
commit 8b3a8885ee

View File

@@ -18,7 +18,7 @@ fi
function send_webhook() {
local message="$1"
curl -i -H "Accept: application/json" -H "Content-Type:application/json" -X POST --data "{\"content\": \"$message\"}" "$webhook"
curl --silent -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}')
@@ -76,6 +76,10 @@ do
exit
fi
if [ -n "$webhook_url" ]; then
send_webhook "Next schedule: $next_time"
fi
while [ $next_seconds -gt 0 ]
do
echo -ne "\033[0K\rWaiting for $next_time... (in $next_seconds s) "