mirror of
https://github.com/pothi/mikrotik-scripts.git
synced 2025-07-16 01:24:28 +02:00
Re/move unused scripts and add a new combined script
This commit is contained in:
parent
ba16b70013
commit
80469763d7
6 changed files with 74 additions and 111 deletions
43
scripts/firmware-check-ros.rsc
Normal file
43
scripts/firmware-check-ros.rsc
Normal file
|
@ -0,0 +1,43 @@
|
|||
# Alert upon new Router OS Version
|
||||
|
||||
# requirement/s:
|
||||
# policy: read, write, policy, test
|
||||
# active internet
|
||||
# $adminEmail
|
||||
|
||||
:global adminEmail
|
||||
:if ([:typeof $adminEmail] = "nothing" || $adminEmail = "") do={
|
||||
:log error "adminEmail is not defined or nil."; :error "Error: Check the log"; }
|
||||
|
||||
:local versionStatus
|
||||
|
||||
:log info "\nChecking for new version of Router OS..."
|
||||
|
||||
/system package update
|
||||
check-for-updates once
|
||||
|
||||
:do {
|
||||
:delay 3s
|
||||
|
||||
:set $versionStatus [get status]
|
||||
# alternative way to get the above info
|
||||
# :set $versionStatus ([print as-value]->"status")
|
||||
} while=( $versionStatus = "finding out latest version..." )
|
||||
|
||||
:local installedVersion [get installed-version]
|
||||
:local latestVersion [get latest-version]
|
||||
|
||||
:if ( $versionStatus = "New version is available" ) do={
|
||||
# alternative method
|
||||
# :if ( installedVersion != $latestVersion ) do={
|
||||
:log info "A new update is available for Router OS."
|
||||
/tool e-mail send to="$adminEmail" \
|
||||
subject="Software Update is Available" \
|
||||
body="A new Router OS update is available...
|
||||
|
||||
Installed Version: $installedVersion
|
||||
Latest Version: $latestVersion
|
||||
"
|
||||
} else={
|
||||
:log info "Router OS is up to date."
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue