This commit is contained in:
Heavybullets8 2022-07-26 17:28:51 -06:00
parent 0fb6383ce5
commit 3d151ed857

View File

@ -50,39 +50,62 @@ menu(){
script_path=$(dirname "$script") script_path=$(dirname "$script")
script_name="heavy_script.sh" script_name="heavy_script.sh"
cd "$script_path" || exit cd "$script_path" || exit
clear -x while true
title do
echo "Choose Your Update Type" clear -x
echo "-----------------------" title
echo "1) -U | Update all applications, ignores versions" echo "Choose Your Update Type"
echo "2) -u | Update all applications, does not update Major releases" echo "-----------------------"
echo echo "1) -U | Update all applications, ignores versions"
echo "0) Exit" echo "2) -u | Update all applications, does not update Major releases"
echo echo
read -rt 600 -p "Please type the number associated with the flag above: " current_selection echo "0) Exit"
if [[ $current_selection == 1 ]]; then echo
echo -e "\nHow many applications do you want updating at the same time?" read -rt 600 -p "Please type the number associated with the flag above: " current_selection
read -rt 600 -p "Please type an integer greater than 0: " up_async if [[ $current_selection == 1 ]]; then
elif [[ $current_selection == 2 ]]; then echo -e "\nHow many applications do you want updating at the same time?"
echo -e "\nHow many applications do you want updating at the same time?" read -rt 600 -p "Please type an integer greater than 0: " up_async
read -rt 600 -p "Please type an integer greater than 0: " up_async if [[ $up_async == 0 ]]; then
elif [[ $current_selection == 0 ]]; then echo "Error: \"$up_async\" is less than 1"
echo "Exiting.." echo "NOT adding it to the list"
exit sleep 5
else continue
echo "$current_selection was not an option, try again" elif ! [[ $up_async =~ ^[0-9]+$ ]]; then
exit echo "Error: \"$up_async\" is invalid, it needs to be an integer"
fi echo "NOT adding it to the list"
if [[ $up_async == 0 ]]; then sleep 5
echo "0 was not an option.. exiting" continue
exit else
elif ! [[ $up_async =~ ^[0-9]+$ ]]; then update_selection+=("-U" "$up_async")
echo "Error: \"$up_async\" is invalid, it needs to be an integer" update_list+=("-U")
exit break
else fi
update_selection+=("-u" "$up_async") elif [[ $current_selection == 2 ]]; then
update_list+=("-u") echo -e "\nHow many applications do you want updating at the same time?"
fi read -rt 600 -p "Please type an integer greater than 0: " up_async
if [[ $up_async == 0 ]]; then
echo "Error: \"$up_async\" is less than 1"
echo "NOT adding it to the list"
sleep 5
continue
elif ! [[ $up_async =~ ^[0-9]+$ ]]; then
echo "Error: \"$up_async\" is invalid, it needs to be an integer"
echo "NOT adding it to the list"
sleep 5
continue
else
update_selection+=("-u" "$up_async")
update_list+=("-u")
break
fi
elif [[ $current_selection == 0 ]]; then
echo "Exiting.."
exit
else
echo "$current_selection was not an option, try again"
exit
fi
done
while true while true
do do
clear -x clear -x