From bdf6641fac760250ce03b16c5bd219470b695109 Mon Sep 17 00:00:00 2001 From: kyler Date: Thu, 21 Apr 2022 21:46:50 -0600 Subject: [PATCH] fixing issue with multiple applications have similar name. --- heavy_script.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/heavy_script.sh b/heavy_script.sh index 8746fa2f..d45b4a85 100644 --- a/heavy_script.sh +++ b/heavy_script.sh @@ -28,8 +28,8 @@ do echo "$list" && read -p "Please type a number : " selection app=$(echo -e "$list" | grep ^$selection | awk '{print $2}' | cut -c 4-) pvc=$(echo -e "$list" | grep ^$selection || echo -e "\nInvalid selection") - status=$(cli -m csv -c 'app chart_release query name,status' | grep $app | awk -F ',' '{print $2}'| tr -d " \t\n\r") && SECONDS=0 && timeout=200 - [[ "$status" != "STOPPED" ]] && echo -e "\nScaling down $app" && midclt call chart.release.scale $app '{"replica_count": 0}' &> /dev/null + status=$(cli -m csv -c 'app chart_release query name,status' | grep -w $app | awk -F ',' '{print $2}'| tr -d " \t\n\r") && SECONDS=0 && timeout=200 + [[ "$status" != "STOPPED" ]] && echo -e "\nScaling down -w $app" && midclt call chart.release.scale $app '{"replica_count": 0}' &> /dev/null while [[ "$SECONDS" -le "$timeout" && "$status" != "STOPPED" ]] do status=$(cli -m csv -c 'app chart_release query name,status' | grep $app | awk -F ',' '{print $2}'|tr -d " \t\n\r")