Files
ddns/ddnsupd.sh

16 lines
265 B
Bash
Raw Normal View History

2017-02-07 20:04:29 +00:00
#!/bin/bash
2017-03-15 08:25:36 -05:00
(oldip=0
2017-02-07 20:04:29 +00:00
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
2017-03-15 08:25:36 -05:00
done ) &
2017-02-07 20:04:29 +00:00