mirror of
https://github.com/pothi/mikrotik-scripts.git
synced 2025-07-05 04:04:32 +02:00
Modify script to include alternative methods
This commit is contained in:
parent
6e712e1964
commit
422d5f5c0e
1 changed files with 22 additions and 3 deletions
|
@ -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={
|
/system package update
|
||||||
/tool e-mail send to="$emailAddress" subject="[Mikrotik] A new update is available" body="See subject!"
|
|
||||||
|
# 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"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue