Skip to content

Commit

Permalink
select the newest ipv6 address
Browse files Browse the repository at this point in the history
  • Loading branch information
kaedeair committed Nov 23, 2021
1 parent 844f841 commit 0f8ae17
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ardnspod
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ arWanIp6() {

case $(uname) in
'Linux')
hostIp=$(ip -o -6 addr list | grep -Ev '\s(docker|lo)' | awk '{print $4}' | 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" | tail -n 1)
;;
'Darwin')
hostIp=$(ifconfig | grep "inet6 " | awk '{print $2}' | grep -Ev "$lanIps" | tail -n 1)
Expand Down

0 comments on commit 0f8ae17

Please sign in to comment.