Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- username=your_opendns_username
- passwd=your_opendns_password
- log_dir=/home/some_user_dir/.opendns
- if [ ! -d $log_dir ]; then
- mkdir $log_dir
- fi
- if [ -e $log_dir/log ]; then
- mv $log_dir/log $log_dir/log.1
- fi
- date >> $log_dir/log
- oldip=`/usr/bin/curl http://nst.sourceforge.net/nst/tools/ip.php -silent -i`
- while [ 1 ]
- do
- newip=`/usr/bin/curl http://nst.sourceforge.net/nst/tools/ip.php -silent -i`
- if [ $oldip != $newip ]
- then
- /usr/bin/curl -i -m 60 -k -u $username:$passwd 'https://updates.opendns.com/account/ddns.php?' -silent >> $log_dir/log
- echo -e "\n" >> $log_dir/log
- $oldip = $newip
- fi
- sleep 60
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement