nekem egy ilyen kis script van a routeremen (openwrt), ha változik az ip elküldi az új ip címet e-mailen, cronból fut
#/bin/sh
if [ ! -f ~/.current_ip ]; then
echo "o" > ~/.current_ip
fi
IPADDRESS=$(/sbin/ifconfig pppoe-wan | sed -n 's/.*inet addr:\([^ ]*\).*/\1/p')
LASTIP=`cat ~/.current_ip`;
if [[ ${IPADDRESS} != ${LASTIP} ]]
then
mailsend -domain xxxx.xx -f xxx@xxx.xx -t xx@xxxx.xx -smtp xxxx.xx -port 3333 -sub "Router new IP address is ${IPADDRESS}" -msg-body ~/.current_ip
echo ${IPADDRESS} >|~/.current_ip
fi