Fix IP check for the case where all services fail
Last commit would still not fix the problem if all services fails because of the check on line 38.
This commit is contained in:
parent
9b59388a58
commit
928616e9e0
1 changed files with 2 additions and 3 deletions
|
@ -29,9 +29,8 @@ while ( true ); do
|
||||||
for service in ${services[@]}; do
|
for service in ${services[@]}; do
|
||||||
echo "Trying with $service..."
|
echo "Trying with $service..."
|
||||||
|
|
||||||
ip="$(curl -s $service)"
|
ip="$(curl -s $service | grep '[0-9]\{1,3\}\(\.[0-9]\{1,3\}\)\{3\}')"
|
||||||
valid_ip=$(echo $ip | grep '[0-9]\{1,3\}\(\.[0-9]\{1,3\}\)\{3\}')
|
test -n "$ip" && break
|
||||||
test -n "$valid_ip" && break
|
|
||||||
done
|
done
|
||||||
|
|
||||||
echo "Found IP address $ip"
|
echo "Found IP address $ip"
|
||||||
|
|
Loading…
Reference in a new issue