diff --git a/scripts/alert-upon-new-version.rsc b/scripts/alert-upon-new-version.rsc index c441db1..8d80ab8 100644 --- a/scripts/alert-upon-new-version.rsc +++ b/scripts/alert-upon-new-version.rsc @@ -1,5 +1,24 @@ -/system package update check-for-updates once; :delay 10s; +# Alert upon new version +# requirement $adminEmailAddress or configure it below +# :local adminEmailAddress "admin@example.com" -:if ( [get status] = "New version is available") do={ - /tool e-mail send to="$emailAddress" subject="[Mikrotik] A new update is available" body="See subject!" +/system package update + +# check-for-updates once +# :delay 10s +:local verionStatus + +:set $versionStatus [get status] +# alternative way to get the above info +# :set $versionStatus ([print as-value]->"status") + +:put $versionStatus +:put $adminEmailAddress + +# alternative method +# :if ( [get installed-version] != [get latest-version] ) do={ +:if ( $versionStatus = "New version is available" ) do={ + /tool e-mail send to="$adminEmailAddress" \ + subject="[Mikrotik] Software Up date Available" \ + body="A new update is available for your MikroTik device" }