#!/bin/sh
ip_file='/var/log/ip.log'
new_ip=`ifconfig | grep 'P-t-P' | awk -F':' '{print $2}' | awk '{print $1}'`
old_ip=`cat ${ip_file}`

echo $new_ip
echo $old_ip
if [ -z ${new_ip} ]; then
        exit 0
fi



if [ -z ${old_ip} ]  || [ ${new_ip} != ${old_ip} ]
then
        echo ${new_ip} > ${ip_file}
        echo "dnsmasq restart"
        /etc/init.d/dnsmasq restart
fi
