mirror of
https://gitea.blesmrt.net/mikaela/scripts.git
synced 2024-12-31 23:32:35 +01:00
parent
5e0a611c4d
commit
b4421b0845
@ -18,7 +18,11 @@ PASSWORD=""
|
||||
HOSTNAME=""
|
||||
|
||||
# Get IPv4 address
|
||||
WAN_IP4=$(dig +short myip.opendns.com. A @208.67.220.220)
|
||||
if hash dig 2>/dev/null; then
|
||||
WAN_IP4=$(dig +short myip.opendns.com. A @208.67.220.220)
|
||||
else
|
||||
WAN_IP4=$(curl -L4 https://icanhazip.com/)
|
||||
fi
|
||||
if [ -f $HOME/.wan_ip4-ydns.txt ]; then
|
||||
OLD_WAN_IP4=$(cat $HOME/.wan_ip4-ydns.txt)
|
||||
else
|
||||
@ -27,7 +31,11 @@ else
|
||||
fi
|
||||
|
||||
# Get IPv6 address
|
||||
WAN_IP6=$(dig +short myip.opendns.com. AAAA @2620:0:ccd::2)
|
||||
if hash dig 2>/dev/null; then
|
||||
WAN_IP6=$(dig +short myip.opendns.com. AAAA @2620:0:ccd::2)
|
||||
else
|
||||
WAN_IP6=$(curl -L6 https://icanhazip.com/)
|
||||
fi
|
||||
if [ -f $HOME/.wan_ip6-ydns.txt ]; then
|
||||
OLD_WAN_IP6=$(cat $HOME/.wan_ip6-ydns.txt)
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user