diff --git a/dyndns.sh b/dyndns.sh index f17a281..325658a 100755 --- a/dyndns.sh +++ b/dyndns.sh @@ -29,9 +29,8 @@ while ( true ); do for service in ${services[@]}; do echo "Trying with $service..." - ip="$(curl -s $service)" - valid_ip=$(echo $ip | grep '[0-9]\{1,3\}\(\.[0-9]\{1,3\}\)\{3\}') - test -n "$valid_ip" && break + ip="$(curl -s $service | grep '[0-9]\{1,3\}\(\.[0-9]\{1,3\}\)\{3\}')" + test -n "$ip" && break done echo "Found IP address $ip"