[[ -z "$list_backups"]]&&echo"No restore points available"&&exit||{ title;echo -e "Choose a restore point to delete\nThese may be out of order if they are not HeavyScript backups";}
echo"$list_backups"&&read -t 600 -p "Please type a number: " selection &&restore_point=$(echo"$list_backups"| grep ^"$selection"| awk '{print $2}')
[[ -z "$selection"]]&&echo"Your selection cannot be empty"&&exit#Check for valid selection. If none, kill script
[[ -z "$restore_point"]]&&echo"Invalid Selection: $selection, was not an option"&&exit#Check for valid selection. If none, kill script
echo -e "\nWARNING:\nYou CANNOT go back after deleting your restore point"||{echo"FAILED"; exit;}
echo -e "\n\nYou have chosen:\n$restore_point\n\nWould you like to continue?"&&echo -e "1 Yes\n2 No"&&read -t 120 -p "Please type a number: " yesno ||{echo"FAILED"; exit;}
echo"$list_backups"&&read -t 600 -p "Please type a number: " selection &&restore_point=$(echo"$list_backups"| grep ^"$selection"| awk '{print $2}')
[[ -z "$selection"]]&&echo"Your selection cannot be empty"&&exit#Check for valid selection. If none, kill script
[[ -z "$restore_point"]]&&echo"Invalid Selection: $selection, was not an option"&&exit#Check for valid selection. If none, kill script
echo -e "\nWARNING:\nThis is NOT guranteed to work\nThis is ONLY supposed to be used as a LAST RESORT\nConsider rolling back your applications instead if possible"||{echo"FAILED"; exit;}
echo -e "\n\nYou have chosen:\n$restore_point\n\nWould you like to continue?"&&echo -e "1 Yes\n2 No"&&read -t 120 -p "Please type a number: " yesno ||{echo"FAILED"; exit;}
if[[$yesno=="1"]];then
echo -e "\nStarting Backup, this will take a LONG time."&& cli -c 'app kubernetes restore_backup backup_name=''"'"$restore_point"'"'||echo"Restore FAILED"
elif[[$yesno=="2"]];then
echo"You've chosen NO, killing script. Good luck."