This commit is contained in:
Heavybullets8 2022-07-26 14:15:42 -06:00
parent 9db9c1d4be
commit e3f8dc9542

View File

@ -9,7 +9,7 @@ menu(){
echo "3 Create a Backup" echo "3 Create a Backup"
echo "4 Restore a Backup" echo "4 Restore a Backup"
echo "5 Delete a Backup" echo "5 Delete a Backup"
echo "6 Update All Apps" echo "6 Update Applications"
read -rt 600 -p "Please select an option by number: " selection read -rt 600 -p "Please select an option by number: " selection
case $selection in case $selection in
@ -43,20 +43,35 @@ menu(){
script_name="heavy_script.sh" script_name="heavy_script.sh"
cd "$script_path" || exit cd "$script_path" || exit
clear -x clear -x
while true
do echo "What type of update would you like?"
echo "Choose your update options "
echo
echo "1) -U | Update all applications, ignores versions" echo "1) -U | Update all applications, ignores versions"
echo "2) -u | Update all applications, does not update Major releases" echo "2) -u | Update all applications, does not update Major releases"
echo "3) -b | Back-up your ix-applications dataset, specify a number after -b" echo "0) Exit"
echo "4) -i | Add application to ignore list, one by one, see example below." read -rt 600 -p "Please type the number associated with the flag above: " current_selection
echo "5) -r | Roll-back applications if they fail to update" if [[ $current_selection == 1 ]]; then
echo "6) -S | Shutdown applications prior to updating" update_selection+=("-U")
echo "7) -v | verbose output" elif [[ $current_selection == 2 ]]; then
echo "8) -t | Set a custom timeout in seconds when checking if either an App or Mountpoint correctly Started, Stopped or (un)Mounted. Defaults to 500 seconds" update_selection+=("-u")
echo "9) -s | sync catalog" elif [[ $current_selection == 0 ]]; then
echo "10) -p | Prune unused/old docker images" echo "Exiting.."
exit
else
echo "$current_selection was not an option, try again"
fi
while true
do
clear -x
echo "Choose your update options "
echo
echo "1) -b | Back-up your ix-applications dataset, specify a number after -b"
echo "2) -i | Add application to ignore list, one by one, see example below."
echo "3) -r | Roll-back applications if they fail to update"
echo "4) -S | Shutdown applications prior to updating"
echo "5) -v | verbose output"
echo "6) -t | Set a custom timeout in seconds when checking if either an App or Mountpoint correctly Started, Stopped or (un)Mounted. Defaults to 500 seconds"
echo "7) -s | sync catalog"
echo "8) -p | Prune unused/old docker images"
echo echo
echo "0) Done making selections, proceed with update" echo "0) Done making selections, proceed with update"
echo echo
@ -65,14 +80,9 @@ menu(){
if [[ $current_selection == 0 ]]; then if [[ $current_selection == 0 ]]; then
exec bash "$script_name" "${update_selection[@]}" exec bash "$script_name" "${update_selection[@]}"
exit exit
else
if [[ $current_selection == 1 ]]; then
update_selection+=("-U")
elif [[ $current_selection == 2 ]]; then
update_selection+=("-u")
elif [[ $current_selection == 3 ]]; then elif [[ $current_selection == 3 ]]; then
read -rt 600 -p "Up to how many backups should we keep?\n Please type an integer: " up_backups read -rt 600 -p "Up to how many backups should we keep?\n Please type an integer: " up_backups
update_selection+=("-b $up_backups") update_selection+=("-b" "$up_backups")
elif [[ $current_selection == 4 ]]; then elif [[ $current_selection == 4 ]]; then
read -rt 600 -p "What is the name of the application we should ignore?: " up_ignore read -rt 600 -p "What is the name of the application we should ignore?: " up_ignore
update_selection+=("-i" "$up_ignore") update_selection+=("-i" "$up_ignore")
@ -84,13 +94,12 @@ menu(){
update_selection+=("-v") update_selection+=("-v")
elif [[ $current_selection == 8 ]]; then elif [[ $current_selection == 8 ]]; then
read -rt 600 -p "What do you want your timeout to be?: " up_timeout read -rt 600 -p "What do you want your timeout to be?: " up_timeout
update_selection+=("-t $up_timeout") update_selection+=("-t" "$up_timeout")
elif [[ $current_selection == 9 ]]; then elif [[ $current_selection == 9 ]]; then
update_selection+=("-s") update_selection+=("-s")
elif [[ $current_selection == 10 ]]; then elif [[ $current_selection == 10 ]]; then
update_selection+=("-p") update_selection+=("-p")
fi fi
fi
done done
;; ;;
*) *)