check for 0 backups

This commit is contained in:
Heavybullets8 2022-07-26 16:49:23 -06:00
parent dd14c6665c
commit cdf7bf6401

View File

@ -107,6 +107,7 @@ menu(){
echo "Up to how many backups should we keep?" echo "Up to how many backups should we keep?"
read -rt 600 -p "Please type an integer: " up_backups read -rt 600 -p "Please type an integer: " up_backups
! [[ $up_backups =~ ^[0-9]+$ ]] && echo -e "Error: \"$up_backups\" is invalid, it needs to be an integer\nNOT adding it to the list" && sleep 5 && continue ! [[ $up_backups =~ ^[0-9]+$ ]] && echo -e "Error: \"$up_backups\" is invalid, it needs to be an integer\nNOT adding it to the list" && sleep 5 && continue
[[ $up_backups == 0 ]] && echo -e "Error: Number of backups cannot be 0\nNOT adding it to the list" && sleep 5 && continue
update_selection+=("-b" "$up_backups") update_selection+=("-b" "$up_backups")
elif [[ $current_selection == 2 ]]; then elif [[ $current_selection == 2 ]]; 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