mirror of
https://github.com/pothi/mikrotik-scripts.git
synced 2025-07-16 09:34:31 +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
27
scripts/firmware-check-rb.rsc
Normal file
27
scripts/firmware-check-rb.rsc
Normal file
|
@ -0,0 +1,27 @@
|
|||
# Notify to upgrade RouterBoard firmware
|
||||
|
||||
# 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 oldVersion
|
||||
:local newVersion
|
||||
|
||||
:log info "\nChecking for pending Routerboard firmware update..."
|
||||
|
||||
/system routerboard
|
||||
:set oldVersion [get current-firmware]
|
||||
:set newVersion [get upgrade-firmware]
|
||||
|
||||
:if ( $oldVersion != $newVersion ) do={
|
||||
:log info "RouterBoard firmware can be upgraded from $oldVersion to $newVersion \n"
|
||||
/tool e-mail send to="$adminEmail" subject="RouterBoard firmware upgrade!" \
|
||||
body="An upgrade from $oldVersion to $newVersion is pending!"
|
||||
} else={
|
||||
:log info "RouterBoard firmware is up to date."
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue