diff --git a/scripts/appgateway/appgw_status.sh b/scripts/appgateway/appgw_status.sh index 0a9a8ceb..e9654856 100755 --- a/scripts/appgateway/appgw_status.sh +++ b/scripts/appgateway/appgw_status.sh @@ -54,11 +54,15 @@ jq -c '.data[]' <<<$APPLICATION_GATEWAYS | while read application_gateway; do case "$APPLICATION_GATEWAY_STATE" in *"Running"*) ts_echo_color $([[ $MODE == "start" ]] && echo GREEN || echo RED) "$logMessage" - [[ $MODE == "stop" ]] && auto_shutdown_notification ":red_circle: $slackMessage" + if [[ $MODE == "stop" ]]; then + auto_shutdown_notification ":red_circle: $slackMessage" + fi ;; *"Stopped"*) ts_echo_color $([[ $MODE == "start" ]] && echo RED || echo GREEN) "$logMessage" - [[ $MODE == "start" ]] && auto_shutdown_notification ":red_circle: $slackMessage" + if [[ $MODE == "start" ]]; then + auto_shutdown_notification ":red_circle: $slackMessage" + fi ;; *) ts_echo_color AMBER "$logMessage" diff --git a/scripts/flexible-server/flexserverstatus.sh b/scripts/flexible-server/flexserverstatus.sh index a99c76a0..75127639 100755 --- a/scripts/flexible-server/flexserverstatus.sh +++ b/scripts/flexible-server/flexserverstatus.sh @@ -54,11 +54,15 @@ jq -c '.data[]' <<<$FLEXIBLE_SERVERS | while read flexibleserver; do case "$SERVER_STATE" in *"Ready"*) ts_echo_color $([[ $MODE == "start" ]] && echo GREEN || echo RED) "$logMessage" - [[ $MODE == "stop" ]] && auto_shutdown_notification ":red_circle: $slackMessage" + if [[ $MODE == "stop" ]]; then + auto_shutdown_notification ":red_circle: $slackMessage" + fi ;; *"Stopped"*) ts_echo_color $([[ $MODE == "start" ]] && echo RED || echo GREEN) "$logMessage" - [[ $MODE == "start" ]] && auto_shutdown_notification ":red_circle: $slackMessage" + if [[ $MODE == "start" ]]; then + auto_shutdown_notification ":red_circle: $slackMessage" + fi ;; *) ts_echo_color AMBER "$logMessage" diff --git a/scripts/vm/vmstatus.sh b/scripts/vm/vmstatus.sh index 9279fd37..68375141 100755 --- a/scripts/vm/vmstatus.sh +++ b/scripts/vm/vmstatus.sh @@ -74,11 +74,15 @@ do case "$VM_STATE" in *"running"*) ts_echo_color $( [[ $MODE == "start" ]] && echo GREEN || echo RED ) "$logMessage" - [[ $MODE == "stop" ]] && auto_shutdown_notification ":red_circle: $slackMessage" + if [[ $MODE == "deallocate" ]]; then + auto_shutdown_notification ":red_circle: $slackMessage" + fi ;; *"deallocated"*) ts_echo_color $( [[ $MODE == "start" ]] && echo RED || echo GREEN ) "$logMessage" - [[ $MODE == "start" ]] && auto_shutdown_notification ":red_circle: $slackMessage" + if [[ $MODE == "start" ]]; then + auto_shutdown_notification ":red_circle: $slackMessage" + fi ;; *) ts_echo_color AMBER "$logMessage"