change if for optargs

This commit is contained in:
m0duspwnens
2020-07-30 11:49:34 -04:00
parent de0b34a66b
commit c099f3c5ec

View File

@@ -200,8 +200,7 @@ verify_latest_update_script() {
while getopts ":b" opt; do
case ${opt} in
b ) # process option b
re='^[0-9]+$'
if [[ $OPTARG =~ $re ]]; then
if [[ "$OPTARG" =~ ^[0-9]+$ ]]; then
BATCHSIZE=$OPTARG
else
echo "Batch size must be a number greater than 0"