From 046e03f9c223390f1817e1cf246b165521717083 Mon Sep 17 00:00:00 2001 From: Heavybullets8 Date: Fri, 2 Sep 2022 17:15:28 -0600 Subject: [PATCH 1/3] compact backup menu --- functions/menu.sh | 60 +++++++++++++++++++++++++++++++++-------------- 1 file changed, 43 insertions(+), 17 deletions(-) diff --git a/functions/menu.sh b/functions/menu.sh index cef7bc6c..122390c6 100644 --- a/functions/menu.sh +++ b/functions/menu.sh @@ -7,18 +7,17 @@ title echo "1) Help" echo "2) List DNS Names" echo "3) Mount and Unmount PVC storage" -echo "4) Create a Backup" -echo "5) Restore a Backup" -echo "6) Delete a Backup" -echo "7) Update HeavyScript" -echo "8) Update Applications" -echo "9) Command to Container" +echo "4) Backup Options" +echo "5) Update HeavyScript" +echo "6) Update Applications" +echo "7) Command to Container" echo echo "0) Exit" read -rt 120 -p "Please select an option by number: " selection || { echo -e "\nFailed to make a selection in time" ; exit; } case $selection in 0) + echo "Exiting.." exit ;; 1) @@ -31,23 +30,50 @@ case $selection in mount ;; 4) - read -rt 120 -p "What is the maximun number of backups you would like?: " number_of_backups || { echo -e "\nFailed to make a selection in time" ; exit; } - ! [[ $number_of_backups =~ ^[0-9]+$ ]] && echo -e "Error: The input must be an interger\n\"""$number_of_backups""\" is not an interger" >&2 && exit - [[ "$number_of_backups" -le 0 ]] && echo "Error: Number of backups is required to be at least 1" && exit + while [[ $backup_selection != true ]] + do + clear -x + title + echo "Backup Menu" + echo "1) Create Backup" + echo "2) Delete Backup" + echo "3) Restore Backup" + echo + echo "0) Exit" + read -rt 120 -p "Please select an option by number: " backup_selection || { echo -e "\nFailed to make a selection in time" ; exit; } + case $backup_selection in + 0) + echo "Exiting.." + exit + ;; + 1) + read -rt 120 -p "What is the maximun number of backups you would like?: " number_of_backups || { echo -e "\nFailed to make a selection in time" ; exit; } + ! [[ $number_of_backups =~ ^[0-9]+$ ]] && echo -e "Error: The input must be an interger\n\"""$number_of_backups""\" is not an interger" >&2 && exit + [[ "$number_of_backups" -le 0 ]] && echo "Error: Number of backups is required to be at least 1" && exit + backup_selection=true + ;; + 2) + backup_selection=true + deleteBackup + ;; + 3) + backup_selection=true + restore + ;; + *) + echo "\"$selection\" was not an option, please try agian" && sleep 3 && continue + ;; + esac + done ;; + 5) - restore - ;; - 6) - deleteBackup - ;; - 7) self_update ;; - 8) + 6) script_create ;; - 9) + 7) cmd_to_container ;; *) From 800cac096fed2fb029e0b59d722cf43d1a7427cf Mon Sep 17 00:00:00 2001 From: Heavybullets8 Date: Fri, 2 Sep 2022 17:24:37 -0600 Subject: [PATCH 2/3] add titles to utility menu --- functions/cmd_to_container.sh | 4 ++++ functions/menu.sh | 3 +++ 2 files changed, 7 insertions(+) diff --git a/functions/cmd_to_container.sh b/functions/cmd_to_container.sh index 72f79990..ad8bf630 100644 --- a/functions/cmd_to_container.sh +++ b/functions/cmd_to_container.sh @@ -7,6 +7,8 @@ while true do clear -x title + echo "Command to Container Menu" + echo "-------------------------" echo "$app_name" echo echo "0) Exit" @@ -45,6 +47,8 @@ case "${#containers[@]}" in do clear -x title + echo "Available Containers" + echo "--------------------" cont_search=$( for i in "${containers[@]}" do diff --git a/functions/menu.sh b/functions/menu.sh index 122390c6..164bdd7b 100644 --- a/functions/menu.sh +++ b/functions/menu.sh @@ -4,6 +4,8 @@ menu(){ clear -x title +echo "Available Utilities" +echo "-------------------" echo "1) Help" echo "2) List DNS Names" echo "3) Mount and Unmount PVC storage" @@ -35,6 +37,7 @@ case $selection in clear -x title echo "Backup Menu" + echo "-----------" echo "1) Create Backup" echo "2) Delete Backup" echo "3) Restore Backup" From 73ce3939fb3c643308c5521e57dfd9e3b1c6160a Mon Sep 17 00:00:00 2001 From: Heavybullets8 Date: Fri, 2 Sep 2022 17:28:47 -0600 Subject: [PATCH 3/3] add title for mount menu --- functions/mount.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/functions/mount.sh b/functions/mount.sh index 22665cc0..00c3cf93 100644 --- a/functions/mount.sh +++ b/functions/mount.sh @@ -7,6 +7,8 @@ while true do clear -x title + echo "PVC Mount Menu" + echo "--------------" echo "1) Mount" echo "2) Unmount All" echo