ydns6: fixes

This commit is contained in:
Aminda Suomalainen 2015-12-25 09:42:22 +02:00
parent da67dedf33
commit 904675e310
1 changed files with 3 additions and 3 deletions

View File

@ -29,7 +29,7 @@ else
WAN_IP6=$(curl -sL6 https://icanhazip.com/)
fi
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
echo "No file, need IP6"
OLD_WAN_IP6=""
@ -39,8 +39,8 @@ fi
if [ "$WAN_IP6" = "$OLD_WAN_IP6" ]; then
echo "IP6 Unchanged"
else
echo $WAN_IP6 > $HOME/.wan_ip6-ydns.txt
echo $WAN_IP6 > $HOME/.ydns6.txt
echo "Updating DNS to $WAN_IP6"
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