动态ip更新

vim update_id.sh

ip=`curl http://myip.ustclug.org/`
url="https://api.dynu.com/nic/update?hostname=****.dynu.net&myip=${ip}&username=****&password=****"

host_ip=`host ****.dynu.net| awk -F ' ' '{print $4}'`

if [ $ip != $host_ip ]
then
  curl $url
else
  echo $ip
  echo $host_ip
fi

chmod 777 update_ip.sh
#添加到/etc/crontab