From df8788ed9572e956d84f71495d931980bb69d3e6 Mon Sep 17 00:00:00 2001 From: Lightemerald Date: Thu, 18 May 2023 21:58:08 +0200 Subject: [PATCH] Fix variable name --- start.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/start.sh b/start.sh index d5b0d31..7a51ede 100644 --- a/start.sh +++ b/start.sh @@ -69,14 +69,14 @@ do if [ $next_seconds -lt 0 ] then - if [ -n "$webhook_url" ]; then + if [ -n "$webhook" ]; then send_webhook "ERROR: Schedules are not setup correctly!" fi echo 'schedule error, exiting...' exit fi - if [ -n "$webhook_url" ]; then + if [ -n "$webhook" ]; then send_webhook "Next schedule: $next_time" fi @@ -92,7 +92,7 @@ do next_vpn_index=$(( $next_index + 1 )) vpn=$(echo "$vpns" | sed -n "${next_vpn_index}p") echo "VPN: [$next_vpn_index] - $vpn" - if [ -n "$webhook_url" ]; then + if [ -n "$webhook" ]; then send_webhook "Switching to VPN: [$next_vpn_index] - $vpn" fi @@ -111,7 +111,7 @@ do then echo "VPN connection successfully established" echo "Starting script..." - if [ -n "$webhook_url" ]; then + if [ -n "$webhook" ]; then send_webhook "VPN connection successfully established.\nStarting script..." fi if [ -f "./Microsoft-Rewards-bot/$vpn.json" ] @@ -135,7 +135,7 @@ do break else echo "File ./Microsoft-Rewards-bot/$vpn.json does not exist, skipping starting bot for this VPN" - if [ -n "$webhook_url" ]; then + if [ -n "$webhook" ]; then send_webhook "ERROR: File ./Microsoft-Rewards-bot/$vpn.json does not exist, skipping starting bot for this VPN" fi read -t 3 @@ -143,13 +143,13 @@ do fi else echo "Failed to establish VPN connection (attempt $attempt of $retries)" - if [ -n "$webhook_url" ]; then + if [ -n "$webhook" ]; then send_webhook "ERROR: Failed to establish VPN connection (attempt $attempt of $retries)" fi if [ $attempt -eq $retries ] then echo "Max retries reached, switching to the next schedule" - if [ -n "$webhook_url" ]; then + if [ -n "$webhook" ]; then send_webhook "ERROR: Max retries reached, switching to the next schedule" fi fi @@ -159,7 +159,7 @@ do done else echo "ERROR: VPN name is empty" - if [ -n "$webhook_url" ]; then + if [ -n "$webhook" ]; then send_webhook "ERROR: VPN name is empty" fi fi