yes no revamp

This commit is contained in:
Heavybullets8 2022-07-30 16:57:52 -06:00
parent 0e60f84c22
commit 79a0531da6
2 changed files with 15 additions and 22 deletions

View File

@ -66,17 +66,16 @@ do
do
clear -x
echo -e "\nWARNING:\nYou CANNOT go back after deleting your restore point"
echo -e "\n\nYou have chosen:\n$restore_point\n\nWould you like to continue?"
echo -e "Y) Yes\nN) No\n"
read -rt 120 -p "Please type a number: " yesno || { echo -e "\nFailed to make a selection in time" ; exit; }
echo -e "\n\nYou have chosen:\n$restore_point\n\n"
read -rt 120 -p "Would you like to proceed with deletion? (y/N) " yesno || { echo -e "\nFailed to make a selection in time" ; exit; }
case $yesno in
[Yy])
[Yy] | [Yy][Ee][Ss])
echo -e "\nDeleting $restore_point"
cli -c 'app kubernetes delete_backup backup_name=''"'"$restore_point"'"' &>/dev/null || { echo "Failed to delete backup.."; exit; }
echo "Sucessfully deleted"
break
;;
[Nn])
[Nn] | [Nn][Oo])
echo "Exiting"
exit
;;
@ -89,15 +88,12 @@ do
done
while true
do
echo "Delete more?"
echo "Y) Yes"
echo "N) No"
read -rt 120 -p "Please type a number: " yesno || { echo -e "\nFailed to make a selection in time" ; exit; }
read -rt 120 -p "Delete more backups? (y/N)" yesno || { echo -e "\nFailed to make a selection in time" ; exit; }
case $yesno in
[Yy])
[Yy] | [Yy][Ee][Ss])
break
;;
[Nn])
[Nn] | [Nn][Oo])
exit
;;
*)
@ -151,16 +147,15 @@ do
do
clear -x
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 -e "\n\nYou have chosen:\n$restore_point\n\nWould you like to continue?"
echo -e "Y) Yes\nN) No\n"
read -rt 120 -p "Please type a number: " yesno || { echo -e "\nFailed to make a selection in time" ; exit; }
echo -e "\n\nYou have chosen:\n$restore_point\n\n"
read -rt 120 -p "Would you like to proceed with restore? (y/N) " yesno || { echo -e "\nFailed to make a selection in time" ; exit; }
case $yesno in
[Yy])
[Yy] | [Yy][Ee][Ss])
echo -e "\nStarting Backup, this will take a LONG time."
cli -c 'app kubernetes restore_backup backup_name=''"'"$restore_point"'"' || { echo "Failed to delete backup.."; exit; }
exit
;;
[Nn])
[Nn] | [Nn][Oo])
echo "Exiting"
exit
;;

View File

@ -58,17 +58,15 @@ do
echo -e "Mounted\n\nUnmount with:\nzfs set mountpoint=legacy $full_path && rmdir /mnt/heavyscript/$data_name\n\nOr use the Unmount All option\n"
while true
do
echo -e "\nWould you like to mount anything else?"
echo "Y) Yes"
echo "N) No"
read -rt 120 -p "Please type a number: " yesno || { echo -e "\nFailed to make a selection in time" ; exit; }
echo
read -rt 120 -p "Would you like to mount anything else? (y/N) " yesno || { echo -e "\nFailed to make a selection in time" ; exit; }
case $yesno in
[Yy])
[Yy] | [Yy][Ee][Ss])
clear -x
title
break
;;
[Nn])
[Nn] | [Nn][Oo])
exit
;;
*)