From 79a0531da63d71c1d30a5c59be25711e4ad2da04 Mon Sep 17 00:00:00 2001 From: Heavybullets8 Date: Sat, 30 Jul 2022 16:57:52 -0600 Subject: [PATCH] yes no revamp --- functions/backup.sh | 27 +++++++++++---------------- functions/mount.sh | 10 ++++------ 2 files changed, 15 insertions(+), 22 deletions(-) diff --git a/functions/backup.sh b/functions/backup.sh index 9cfac408..07a6fb23 100644 --- a/functions/backup.sh +++ b/functions/backup.sh @@ -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 ;; diff --git a/functions/mount.sh b/functions/mount.sh index dfb0ac22..b866d489 100644 --- a/functions/mount.sh +++ b/functions/mount.sh @@ -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 ;; *)