restore update

This commit is contained in:
Heavybullets8 2022-07-29 00:34:55 -06:00
parent 291ad68542
commit 73f060cea3

View File

@ -119,30 +119,33 @@ while true
do do
clear -x && echo "pulling restore points.." clear -x && echo "pulling restore points.."
list_backups=$(cli -c 'app kubernetes list_backups' | grep "HeavyScript_" | sort -t '_' -Vr -k2,7 | tr -d " \t\r" | awk -F '|' '{print $2}' | nl -s ") " | column -t) list_backups=$(cli -c 'app kubernetes list_backups' | grep "HeavyScript_" | sort -t '_' -Vr -k2,7 | tr -d " \t\r" | awk -F '|' '{print $2}' | nl -s ") " | column -t)
clear -x
if [[ -z "$list_backups" ]]; then if [[ -z "$list_backups" ]]; then
echo "No HeavyScript restore points available" echo "No HeavyScript restore points available"
exit exit
else fi
while true
do
clear -x
title title
echo "Choose a Restore Point" echo "Choose a Restore Point"
fi echo "$list_backups"
echo "$list_backups" echo
echo echo "0) Exit"
echo "0) Exit" read -rt 120 -p "Please type a number: " selection
read -rt 120 -p "Please type a number: " selection restore_point=$(echo "$list_backups" | grep ^"$selection)" | awk '{print $2}')
[[ $selection == 0 ]] && echo "Exiting.." && exit if [[ $selection == 0 ]]; then
restore_point=$(echo "$list_backups" | grep ^"$selection)" | awk '{print $2}') echo "Exiting.."
#Check for valid selection. If none, kill script exit
if [[ -z "$selection" ]]; then elif [[ -z "$selection" ]]; then
echo "Your selection cannot be empty" echo "Your selection cannot be empty"
sleep 3 sleep 3
continue continue
elif [[ -z "$restore_point" ]]; then elif [[ -z "$restore_point" ]]; then
echo "Invalid Selection: $selection, was not an option" echo "Invalid Selection: $selection, was not an option"
sleep 3 sleep 3
continue continue
fi fi
done
while true while true
do do
clear -x clear -x