Update ardnspod

This commit is contained in:
rehiy authored and GitHub committed 2021-11-25 13:48:35 +08:00
1 parent 325669d99c
commit 2c1c547782
1 file changed
+4 -4
+4 -4
View File
@@ -69,14 +69,14 @@ arWanIp6() {
local hostIp
local lanIps="(^$)|(^::1$)|(^fe[8-9,A-F])"
local lanIps="(^$)|(^::1$)|(^[fF][eE][8-9a-fA-F])"
case $(uname) in
'Linux')
hostIp=$(ip -o -6 addr list | grep -Ev '\s(docker|lo)' | awk '{print $4,substr($NF,0,length($NF)-3)}' | sed 's/fore/2592000/g' | sort -k 2 -n | cut -d/ -f1 | grep -Ev "$lanIps" | tail -n 1)
hostIp=$(ip -o -6 addr list | grep -Ev '\s(docker|lo)' | awk '{print $4,substr($NF,0,length($NF)-3)}' | sed 's/fore/2592000/g' | sort -k 2 -n | cut -d/ -f1 | grep -Ev "$lanIps" | head -n 1)
;;
'Darwin')
hostIp=$(ifconfig | grep "inet6 " | awk '{print $2}' | grep -Ev "$lanIps" | tail -n 1)
hostIp=$(ifconfig | grep "inet6 " | awk '{print $2}' | grep -Ev "$lanIps" | head -n 1)
;;
esac
@@ -168,7 +168,7 @@ arDdnsRecordIp() {
# Output Record Ip
case "$recordIp" in
[1-9]*)
[0-9a-fA-F]*)
echo $recordIp
return 0
;;