Modify script to include alternative methods

This commit is contained in:
Pothi Kalimuthu 2022-02-12 08:47:47 +05:30
parent 6e712e1964
commit 422d5f5c0e

View file

@ -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"
}