In the setup of series 13, I receive too many email telling my IP address of both diskstations. I think I should receive email alert ONLY when public IP address is changed.
The simple script I written here is running non-stop for a year, it is working just fine on my DS
So I wrote another bash script and have it run on my diskstations. Since it generate email only when IP address is changed, I can have the diskstations run the script like every 15 minutes.
Noted: the script need wget, bash and nail to work.
You need to edit /etc/crontab and restart cron daemon in order to have Diskstation to execute the scripts periodically.
Following /etc/crontab executes the script per 15 minutes.
*/15 * * * * root /bin/sh /opt/bin/checkip.sh
To restart cron daemon:
DiskStation> /usr/syno/etc/rc.d/S04crond.sh stop
DiskStation> /usr/syno/etc/rc.d/S04crond.sh start
Update Jul 26 2009
After over 12 hours testing, the script is working and I’m receiving email alert only when IP is changed now. 🙂
The script is in page 2.