optimize validate function

This commit is contained in:
Nils 2021-12-04 00:17:18 +01:00
parent e68d8d52b2
commit bce9576c2d
Signed by: byreqz
GPG Key ID: 396A62D7D436749E
1 changed files with 2 additions and 2 deletions

View File

@ -108,9 +108,9 @@ function set_argvars {
function validate {
for arg in $@; do
if $(ip route show " $arg" 2&> /dev/null);then
if ip route show " $arg" 2&> /dev/null;then
hosts="$hosts $arg"
elif $(nslookup "$arg" > /dev/null);then
elif nslookup "$arg" > /dev/null;then
hosts="$hosts $arg"
else
echo "invalid input: $arg"