mirror of
https://gitea.blesmrt.net/mikaela/scripts.git
synced 2024-11-26 13:09:29 +01:00
ydns6: fixes
This commit is contained in:
parent
da67dedf33
commit
904675e310
@ -29,7 +29,7 @@ else
|
|||||||
WAN_IP6=$(curl -sL6 https://icanhazip.com/)
|
WAN_IP6=$(curl -sL6 https://icanhazip.com/)
|
||||||
fi
|
fi
|
||||||
if [ -f $HOME/.wan_ip6-ydns.txt ]; then
|
if [ -f $HOME/.wan_ip6-ydns.txt ]; then
|
||||||
OLD_WAN_IP6=$(cat $HOME/.wan_ip6-ydns.txt)
|
OLD_WAN_IP6=$(cat $HOME/.ydns6.txt)
|
||||||
else
|
else
|
||||||
echo "No file, need IP6"
|
echo "No file, need IP6"
|
||||||
OLD_WAN_IP6=""
|
OLD_WAN_IP6=""
|
||||||
@ -39,8 +39,8 @@ fi
|
|||||||
if [ "$WAN_IP6" = "$OLD_WAN_IP6" ]; then
|
if [ "$WAN_IP6" = "$OLD_WAN_IP6" ]; then
|
||||||
echo "IP6 Unchanged"
|
echo "IP6 Unchanged"
|
||||||
else
|
else
|
||||||
echo $WAN_IP6 > $HOME/.wan_ip6-ydns.txt
|
echo $WAN_IP6 > $HOME/.ydns6.txt
|
||||||
echo "Updating DNS to $WAN_IP6"
|
echo "Updating DNS to $WAN_IP6"
|
||||||
curl -6 --basic -u "$USEREMAIL:$PASSWORD" --silent \
|
curl -6 --basic -u "$USEREMAIL:$PASSWORD" --silent \
|
||||||
https://ydns.eu/api/v1/update/?host=$HOSTNAME
|
https://ydns.io/api/v1/update/?host=$HOSTNAME\&ip=$WAN_IP6
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user