Merge pull request #21 from Heavybullets8/compact-backup-menu

- Add menu Titles for items
- Compact Backup menu in sub catagories
This commit is contained in:
Heavybullets8 2022-09-03 23:22:36 +00:00 committed by GitHub
commit 5c699f35e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 52 additions and 17 deletions

View File

@ -7,6 +7,8 @@ while true
do do
clear -x clear -x
title title
echo "Command to Container Menu"
echo "-------------------------"
echo "$app_name" echo "$app_name"
echo echo
echo "0) Exit" echo "0) Exit"
@ -45,6 +47,8 @@ case "${#containers[@]}" in
do do
clear -x clear -x
title title
echo "Available Containers"
echo "--------------------"
cont_search=$( cont_search=$(
for i in "${containers[@]}" for i in "${containers[@]}"
do do

View File

@ -4,21 +4,22 @@
menu(){ menu(){
clear -x clear -x
title title
echo "Available Utilities"
echo "-------------------"
echo "1) Help" echo "1) Help"
echo "2) List DNS Names" echo "2) List DNS Names"
echo "3) Mount and Unmount PVC storage" echo "3) Mount and Unmount PVC storage"
echo "4) Create a Backup" echo "4) Backup Options"
echo "5) Restore a Backup" echo "5) Update HeavyScript"
echo "6) Delete a Backup" echo "6) Update Applications"
echo "7) Update HeavyScript" echo "7) Command to Container"
echo "8) Update Applications"
echo "9) Command to Container"
echo echo
echo "0) Exit" echo "0) Exit"
read -rt 120 -p "Please select an option by number: " selection || { echo -e "\nFailed to make a selection in time" ; 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 case $selection in
0) 0)
echo "Exiting.."
exit exit
;; ;;
1) 1)
@ -31,23 +32,51 @@ case $selection in
mount mount
;; ;;
4) 4)
while [[ $backup_selection != true ]]
do
clear -x
title
echo "Backup Menu"
echo "-----------"
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; } 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 =~ ^[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 [[ "$number_of_backups" -le 0 ]] && echo "Error: Number of backups is required to be at least 1" && exit
backup_selection=true
;; ;;
5) 2)
restore backup_selection=true
;;
6)
deleteBackup deleteBackup
;; ;;
7) 3)
backup_selection=true
restore
;;
*)
echo "\"$selection\" was not an option, please try agian" && sleep 3 && continue
;;
esac
done
;;
5)
self_update self_update
;; ;;
8) 6)
script_create script_create
;; ;;
9) 7)
cmd_to_container cmd_to_container
;; ;;
*) *)

View File

@ -7,6 +7,8 @@ while true
do do
clear -x clear -x
title title
echo "PVC Mount Menu"
echo "--------------"
echo "1) Mount" echo "1) Mount"
echo "2) Unmount All" echo "2) Unmount All"
echo echo