while loop for menu test

This commit is contained in:
Heavybullets8 2022-07-26 18:16:56 -06:00
parent ac95a304d7
commit 61a591f023
2 changed files with 172 additions and 164 deletions

View File

@ -14,19 +14,23 @@ menu(){
echo
echo "0) Exit"
read -rt 600 -p "Please select an option by number: " selection
while true
do
case $selection in
0)
exit
;;
1)
help="true"
exit
;;
2)
dns="true"
exit
;;
3)
mount="true"
exit
;;
4)
read -rt 600 -p "Please type the max number of backups to keep: " number_of_backups
@ -38,12 +42,15 @@ menu(){
;;
5)
restore="true"
exit
;;
6)
deleteBackup="true"
exit
;;
7)
self_update="true"
exit
;;
8)
script=$(readlink -f "$0")
@ -169,11 +176,13 @@ menu(){
echo "$current_selection was not an option, try again" && sleep 5 && continue
fi
done
exit
;;
*)
echo "Unknown option" && exit 1
echo "That was not an option, please try again" && sleep 5
;;
esac
echo
done
}
export -f menu

View File

@ -19,7 +19,6 @@ do
do
kill -0 "$proc" &> /dev/null || { unset "processes[$count]"; ((proc_count--)); }
done
#jobs=$(jobs -p | wc -l)
if [[ "$proc_count" -ge "$update_limit" ]]; then
sleep 1
else