[[ -z "$list_delete_backups"]]&&echo -e "${IRed}No restore points available${Color_Off}"&&exit||{ title;echo -e "Choose a restore point to delete\nThese may be out of order if they are not TrueTool backups";}
# shellcheck disable=SC2015
echo"$list_delete_backups"&&read -rt 600 -p "Please type a number: " selection &&restore_point=$(echo"$list_delete_backups"| grep ^"$selection"| awk '{print $2}')
[[ -z "$selection"]]&&echo"${IRed}Your selection cannot be empty${Color_Off}"&&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"${IRed}FAILED${Color_Off}"; exit;}
# shellcheck disable=SC2015
echo -e "\n\nYou have chosen:\n$restore_point\n\nWould you like to continue?"&&echo -e "1 Yes\n2 No"&&read -rt 120 -p "Please type a number: " yesno ||{echo"${IRed}FAILED${Color_Off}"; exit;}
echo"$list_restore_backups"&&read -rt 600 -p "Please type a number: " selection &&restore_point=$(echo"$list_restore_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"${IRed}FAILED${Color_Off}"; exit;}
# shellcheck disable=SC2015
echo -e "\n\nYou have chosen:\n$restore_point\n\nWould you like to continue?"&&echo -e "1 Yes\n2 No"&&read -rt 120 -p "Please type a number: " yesno ||{echo"${IRed}FAILED${Color_Off}"; exit;}
if[[$yesno=="1"]];then
echo -e "\nStarting Backup, this will take a ${BWhite}LONG${Color_Off} time."&& cli -c 'app kubernetes restore_backup backup_name=''"'"$restore_point"'"'||echo"Restore ${IRed}FAILED${Color_Off}"
elif[[$yesno=="2"]];then
echo"You've chosen NO, killing script. Good luck."