Skip to content

Instantly share code, notes, and snippets.

@dimitrovs
Created July 31, 2016 00:11
Show Gist options
  • Save dimitrovs/992d7e5e748f59af960084fd6531740d to your computer and use it in GitHub Desktop.
Save dimitrovs/992d7e5e748f59af960084fd6531740d to your computer and use it in GitHub Desktop.
Script to update IPv6 tunnel when IPv4 changes
0,15,30,45 * * * * sh *full path to script here*/*scriptnamehere*.sh &>/dev/null
#!/bin/sh
HE_URL=""
ip1=""
ip2=""
read ip1 < ip.txt
ip2=$(wget -qO- ifconfig.me/ip)
if [ "$ip1" = "$ip2" ]
then
exit
else
echo "$ip2" > ip.txt
wget -qO /dev/null "$HE_URL"
exit
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment