2022-07-26 19:08:33 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
menu(){
|
2022-07-27 01:04:27 +00:00
|
|
|
clear -x
|
|
|
|
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"
|
2022-08-09 02:12:09 +00:00
|
|
|
echo "9) Command to Container"
|
2022-07-27 01:04:27 +00:00
|
|
|
echo
|
|
|
|
echo "0) Exit"
|
2022-08-17 02:36:13 +00:00
|
|
|
read -rt 120 -p "Please select an option by number: " selection || { echo -e "\nFailed to make a selection in time" ; exit; }
|
2022-07-27 00:21:45 +00:00
|
|
|
|
2022-07-27 01:04:27 +00:00
|
|
|
case $selection in
|
2022-07-27 00:21:45 +00:00
|
|
|
0)
|
|
|
|
exit
|
|
|
|
;;
|
|
|
|
1)
|
2022-08-09 04:17:15 +00:00
|
|
|
help
|
2022-07-27 00:21:45 +00:00
|
|
|
;;
|
|
|
|
2)
|
2022-08-09 04:17:15 +00:00
|
|
|
dns
|
2022-07-27 00:21:45 +00:00
|
|
|
;;
|
|
|
|
3)
|
2022-08-09 04:17:15 +00:00
|
|
|
mount
|
2022-07-27 00:21:45 +00:00
|
|
|
;;
|
|
|
|
4)
|
2022-08-17 02:36:13 +00:00
|
|
|
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; }
|
2022-07-27 02:21:48 +00:00
|
|
|
backup="true"
|
2022-07-27 04:45:12 +00:00
|
|
|
;;
|
2022-07-27 00:21:45 +00:00
|
|
|
5)
|
2022-08-09 04:17:15 +00:00
|
|
|
restore
|
2022-07-27 00:21:45 +00:00
|
|
|
;;
|
|
|
|
6)
|
2022-08-09 04:17:15 +00:00
|
|
|
deleteBackup
|
2022-07-27 00:21:45 +00:00
|
|
|
;;
|
|
|
|
7)
|
2022-08-09 04:17:15 +00:00
|
|
|
self_update
|
2022-07-27 00:21:45 +00:00
|
|
|
;;
|
|
|
|
8)
|
2022-08-09 04:17:15 +00:00
|
|
|
script_create
|
2022-07-27 00:21:45 +00:00
|
|
|
;;
|
2022-08-09 02:12:09 +00:00
|
|
|
|
|
|
|
9)
|
2022-08-09 04:17:15 +00:00
|
|
|
cmd_to_container
|
2022-08-09 02:12:09 +00:00
|
|
|
;;
|
2022-07-27 00:21:45 +00:00
|
|
|
*)
|
2022-07-29 22:13:01 +00:00
|
|
|
echo "\"$selection\" was not an option, please try agian" && sleep 3 && menu
|
2022-07-27 00:21:45 +00:00
|
|
|
;;
|
2022-07-27 01:04:27 +00:00
|
|
|
esac
|
|
|
|
echo
|
2022-07-26 19:08:33 +00:00
|
|
|
}
|
2022-08-01 20:16:54 +00:00
|
|
|
export -f menu
|