diff --git a/functions/menu.sh b/functions/menu.sh index 2d4195a0..95008b4a 100644 --- a/functions/menu.sh +++ b/functions/menu.sh @@ -142,7 +142,7 @@ case $selection in ;; 2 | -i) read -rt 600 -p "What is the name of the application we should ignore?: " up_ignore - ! [[ $up_ignore =~ ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ ]] && echo -e "Error: \"$up_ignore\" is invalid, that is not the name youre using for your application" && sleep 5 && continue + ! [[ $up_ignore =~ ^[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?$ ]] && echo -e "Error: \"$up_ignore\" is invalid, that is not the name youre using for your application" && sleep 5 && continue update_selection+=("-i" "$up_ignore") ;; 3 | -r) diff --git a/heavy_script.sh b/heavy_script.sh index 5d539c1d..61caec9a 100644 --- a/heavy_script.sh +++ b/heavy_script.sh @@ -71,15 +71,11 @@ do rollback="true" ;; i) - # Check next positional parameter - eval nextopt=${!OPTIND} - # existing or starting with dash? - if [[ -n $nextopt && $nextopt != -* ]] ; then - OPTIND=$((OPTIND + 1)) - ignore+=("$nextopt") - else - echo "Option: \"-i\" requires an argument" + if ! [[ $OPTARG =~ ^[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?$ ]]; then # Using case insensitive version of the regex used by Truenas Scale + echo -e "Error: \"$OPTARG\" is invalid, that is not the name youre using for your application" exit + else + ignore+=("$OPTARG") fi ;; t)