Skip to content

Commit

Permalink
Merge pull request #783 from hmcts/ieuanb74-patch-4
Browse files Browse the repository at this point in the history
DTSPO-19297 Fix bug in status checks
  • Loading branch information
ieuanb74 authored Oct 9, 2024
2 parents 5b3deaf + c979392 commit e3db3b0
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
8 changes: 6 additions & 2 deletions scripts/appgateway/appgw_status.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
8 changes: 6 additions & 2 deletions scripts/flexible-server/flexserverstatus.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
8 changes: 6 additions & 2 deletions scripts/vm/vmstatus.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit e3db3b0

Please sign in to comment.