mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-02-13 02:51:50 +00:00
smaller timeout to get interface ip
This commit is contained in:
parent
3a6212110f
commit
5b5094c0bb
1 changed files with 1 additions and 1 deletions
|
@ -3,7 +3,7 @@ check_ipv4_website="$(uci -q get openmptcprouter.settings.check_ipv4_website)"
|
||||||
[ -z "$check_ipv4_website" ] && check_ipv4_website="http://ip.openmptcprouter.com"
|
[ -z "$check_ipv4_website" ] && check_ipv4_website="http://ip.openmptcprouter.com"
|
||||||
checkip=$(echo $check_ipv4_website | sed -e 's/https:\/\///' -e 's/http:\/\///' | xargs dig +short A | tr -d "\n")
|
checkip=$(echo $check_ipv4_website | sed -e 's/https:\/\///' -e 's/http:\/\///' | xargs dig +short A | tr -d "\n")
|
||||||
ipset add ss_rules_dst_bypass_all $checkip > /dev/null 2>&1
|
ipset add ss_rules_dst_bypass_all $checkip > /dev/null 2>&1
|
||||||
ip="$(curl -s -4 -m 3 --interface $1 $check_ipv4_website)"
|
ip="$(curl -s -4 -m 2 --interface $1 $check_ipv4_website)"
|
||||||
ipset del ss_rules_dst_bypass_all $checkip > /dev/null 2>&1
|
ipset del ss_rules_dst_bypass_all $checkip > /dev/null 2>&1
|
||||||
if expr "$ip" : '[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*$' >/dev/null; then
|
if expr "$ip" : '[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*$' >/dev/null; then
|
||||||
echo $ip
|
echo $ip
|
||||||
|
|
Loading…
Reference in a new issue