Need Help With some bacsic Scripts

I need two scripts please…


The first one is when the IP address is changed to have an email sent.

The second is a cleanup script for the backup script already in place.

Thanks for your help
Mark

omg:

Read The Fine Manual

http://wiki.mikrotik.com/wiki/Scripting-examples#Check_if_IP_on_interface_have_changed

http://wiki.mikrotik.com/wiki/Scripting-examples#Generate_backup_and_send_it_by_e-mail

Sorry new job. My masters degree did not even remotely inclued computer science. This is all being learned on the fly.

Ok Worked on this for a while and still having trouble.

I have a 133 board running 3.27

A better explanation of what I need.

If someone was to login into the board and change the IP address I would it to email me the new IP address. That is the first script

The second is I figured out the script for backing up the board and getting that emailed out will the back always right over the old? If so there is no reason to delete the backup that it saves.

Thanks for all your help
Mark/golf pro

I guess its better for you to just run a script that emails you the current ip address (scheduled run), because there is no trigger to execute a script when ip changes.
You can also make one script that writes a txt file with the current ip, and another script that compare the current ip to the ip written in the txt file before sending mail (scheduled to run like 1 hour later)..

I dont understand your backup question…

So the script to get current IP address looks like?

:global currentIP;
/file print file=IP
/file set IP.txt contents=“”


:local newIP [/ip address get [find interface=“ether1”] address];

:if ($ newIP != $currentIP) do={
:put “ip address $currentIP changed to $newIP”;
:set currentIP $newIP;
}

Don’t worry about the back up script got that one figured out.

Thanks Mark