diff --git a/centos-mirror-tools/dl_rpms.sh b/centos-mirror-tools/dl_rpms.sh index 67cf7924..5fd66eef 100755 --- a/centos-mirror-tools/dl_rpms.sh +++ b/centos-mirror-tools/dl_rpms.sh @@ -60,7 +60,7 @@ while getopts "c:nxh" o; do c) # Use an alternate yum.conf YUMCONFOPT="-c $OPTARG" - RELEASEVER="--$(grep releasever= ${OPTARG})" + grep -q "releasever=" $OPTARG && RELEASEVER="--$(grep releasever= ${OPTARG})" ;; h) # Help diff --git a/centos-mirror-tools/mirror-check.sh b/centos-mirror-tools/mirror-check.sh index 43a92a17..919cfb80 100755 --- a/centos-mirror-tools/mirror-check.sh +++ b/centos-mirror-tools/mirror-check.sh @@ -115,7 +115,7 @@ while getopts "c:" opt; do case $opt in c) extra_opts="-c ${OPTARG}" - RELEASEVER="--$(grep releasever= ${OPTARG})" + grep -q "releasever=" $OPTARG && RELEASEVER="--$(grep releasever= ${OPTARG})" ;; \?) echo "Invalid option: -$OPTARG" >&2