diff --git a/tools/naptr-eduroam.sh b/tools/naptr-eduroam.sh index 1d45c4d..e5d2da8 100755 --- a/tools/naptr-eduroam.sh +++ b/tools/naptr-eduroam.sh @@ -14,7 +14,6 @@ usage() { test -n "${1}" || usage -REALM="${1}" DIGCMD=$(command -v dig) HOSTCMD=$(command -v host) PRINTCMD=$(command -v printf) @@ -69,6 +68,12 @@ host_it_naptr() { done } +REALM=$(validate_host ${1}) +if [ -z "${REALM}" ]; then + echo "Error: realm \"${1}\" failed validation" + usage +fi + if [ -x "${DIGCMD}" ]; then SERVERS=$(dig_it_naptr) elif [ -x "${HOSTCMD}" ]; then diff --git a/tools/radsec-dynsrv.sh b/tools/radsec-dynsrv.sh index 9ea182c..a1bbed3 100755 --- a/tools/radsec-dynsrv.sh +++ b/tools/radsec-dynsrv.sh @@ -14,7 +14,6 @@ usage() { test -n "${1}" || usage -REALM="${1}" DIGCMD=$(command -v digaaa) HOSTCMD=$(command -v host) PRINTCMD=$(command -v printf) @@ -47,6 +46,12 @@ host_it() { done } +REALM=$(validate_host ${1}) +if test -z "${REALM}" ; then + echo "Error: realm \"${1}\" failed validation" + usage +fi + if test -x "${DIGCMD}" ; then SERVERS=$(dig_it) elif test -x "${HOSTCMD}" ; then