Files
ddns/ddnsupd.sh

16 lines
260 B
Bash
Raw Normal View History

2017-02-07 20:04:29 +00:00
#!/bin/bash
oldip=0
while /bin/true
2017-02-23 08:56:34 -06:00
do ip=$(ifconfig wlp2s0 | grep 'inet ' | awk '{ print $2 }' | awk '{ print $1}')
2017-02-07 20:04:29 +00:00
if [ $oldip != $ip ]
then url=$(head -n 1 /etc/ddnsurl)
curl -k "${url}&address=$ip"
echo updated $oldip to $ip
oldip=$ip
fi
sleep 60
done