remove debugging, checks passed, cleanup
This commit is contained in:
parent
d7f97836ca
commit
d0015c8761
@ -30,9 +30,11 @@ do
|
|||||||
echo
|
echo
|
||||||
echo "0) Exit"
|
echo "0) Exit"
|
||||||
read -rt 120 -p "Please type a number: " selection || { echo -e "\nFailed to make a selection in time" ; exit; }
|
read -rt 120 -p "Please type a number: " selection || { echo -e "\nFailed to make a selection in time" ; exit; }
|
||||||
|
|
||||||
|
#Check for valid selection. If no issues, continue
|
||||||
[[ $selection == 0 ]] && echo "Exiting.." && exit
|
[[ $selection == 0 ]] && echo "Exiting.." && exit
|
||||||
app=$(echo -e "$list" | grep ^"$selection)" | awk '{print $2}' | cut -c 4- )
|
app=$(echo -e "$list" | grep ^"$selection)" | awk '{print $2}' | cut -c 4- )
|
||||||
[[ -z "$app" ]] && echo "Invalid Selection: $selection, was not an option" && sleep 3 && continue #Check for valid selection. If none, contiue
|
[[ -z "$app" ]] && echo "Invalid Selection: $selection, was not an option" && sleep 3 && continue
|
||||||
pvc=$(echo -e "$list" | grep ^"$selection)")
|
pvc=$(echo -e "$list" | grep ^"$selection)")
|
||||||
|
|
||||||
#Stop applicaiton if not stopped
|
#Stop applicaiton if not stopped
|
||||||
@ -43,15 +45,13 @@ do
|
|||||||
echo "Failed to stop $app"
|
echo "Failed to stop $app"
|
||||||
exit 1
|
exit 1
|
||||||
else
|
else
|
||||||
status=$(cli -m csv -c 'app chart_release query name,status' | grep -E "^$app\b" | awk -F ',' '{print $2}'| tr -d " \t\n\r")
|
|
||||||
echo "$status"
|
|
||||||
echo "Stopped"
|
echo "Stopped"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo -e "\n$app is already stopped"
|
echo -e "\n$app is already stopped"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#Grab data then output
|
#Grab data then output and mount
|
||||||
data_name=$(echo "$pvc" | awk '{print $3}')
|
data_name=$(echo "$pvc" | awk '{print $3}')
|
||||||
volume_name=$(echo "$pvc" | awk '{print $4}')
|
volume_name=$(echo "$pvc" | awk '{print $4}')
|
||||||
full_path=$(zfs list | grep "$volume_name" | grep "$pool" | awk '{print $1}')
|
full_path=$(zfs list | grep "$volume_name" | grep "$pool" | awk '{print $1}')
|
||||||
|
Loading…
Reference in New Issue
Block a user