beeyev / Mikrotik-RouterOS-automatic-backup-and-update

Script sends backups to email and keep your mikrotik firmware up to date.
MIT License
442 stars 83 forks source link

Script error at email check for RouterOS 7.12.1 #48

Open AndresCampus opened 10 months ago

AndresCampus commented 10 months ago

I get an error after RouterOS update in section: #Check proper email config The expression [/tool e-mail get address] is not valid because of the "address" value Look like is not longer valid value in that context. I changed to "user", but I am not sure if the meaning of values are similar. Current RouterOS: 7.12.1 Thank you

AndresCampus commented 10 months ago

Looks like "address" was the IP address (of server?), but I can not find "address" anymore inside /tool/e-mail. BTW, there is a "last-address" value. I don't know if they are the same thing. Maybe is better to check if "server" is set. My script copy is working again after solving the issue by changing that value with a valid one

stefan-b-b commented 10 months ago

Hi - The script stopped working when trying to validate the below parts. I just disabled for now to fix. -##

Script messages prefix

:local SMP "Bkp&Upd:"

:log info "\r\n$SMP script \"Mikrotik RouterOS automatic backup & update\" started."; :log info "$SMP Script Mode: $scriptMode, forceBackup: $forceBackup";

Check proper email config

:if ([:len $emailAddress] = 0 or [:len [/tool e-mail get address]] = 0 or [:len [/tool e-mail get from]] = 0) do={

:log error ("$SMP Email configuration is not correct, please check Tools -> Email. Script stopped.");

:error "$SMP bye!";

}

Check if proper identity name is set

if ([:len [/system identity get name]] = 0 or [/system identity get name] = "MikroTik") do={

:log warning ("$SMP Please set identity name of your device (System -> Identity), keep it short and #informative.");

};

beeyev commented 7 months ago

I checked several times, everything seems to work correctly.

crowfeatherjoe commented 2 months ago

running on 7.16rc2 here, i had to change [tool e-mail get address] to [tool e-mail get server]

you may need to update the script to the most recent release as there is a check for this

beeyev commented 2 months ago

Thanks @crowfeatherjoe , I will check it!