This commit is contained in:
Heavybullets8 2022-07-29 00:58:49 -06:00
parent fd26ef349a
commit a211dc9a8a

View File

@ -20,10 +20,12 @@ do
while true
do
list=$(k3s kubectl get pvc -A | sort -u | awk '{print NR-1, "\t" $1 "\t" $2 "\t" $4}' | column -t | sed "s/^0/ /")
clear -x
title
echo "$list"
read -rt 120 -p "Please type a number: " selection
app=$(echo -e "$list" | grep ^"$selection " | awk '{print $2}' | cut -c 4- )
[[ -z "$app" ]] && echo "Invalid Selection: $selection, was not an option" && sleep 3 && clear -x && title && echo "$list" && continue #Check for valid selection. If none, contiue
[[ -z "$app" ]] && echo "Invalid Selection: $selection, was not an option" && sleep 3 && continue #Check for valid selection. If none, contiue
pvc=$(echo -e "$list" | grep ^"$selection ")
status=$(cli -m csv -c 'app chart_release query name,status' | grep -E "^$app\b" | awk -F ',' '{print $2}'| tr -d " \t\n\r")
if [[ "$status" != "STOPPED" ]]; then