mirror of
https://github.com/pothi/mikrotik-scripts.git
synced 2026-01-20 08:09:34 +00:00
Better naming
This commit is contained in:
parent
326ac64fc9
commit
4fb9a237f8
2 changed files with 22 additions and 22 deletions
|
|
@ -16,27 +16,18 @@
|
|||
/system package update
|
||||
check-for-updates once
|
||||
|
||||
:local updateStatus "incomplete"
|
||||
:do {
|
||||
:delay 2s
|
||||
:delay 3s
|
||||
|
||||
:set $updateStatus [get status]
|
||||
|
||||
:if ($updateStatus = "ERROR: no internet connection") do={ :error "ERROT: no internet connection"; }
|
||||
:if ($updateStatus = "ERROR: connection timed out") do={ :error "ERROR: connection timed out"; }
|
||||
|
||||
:if ($updateStatus = "getting changelog...") do={ :set $updateStatus "incomplete" }
|
||||
:if ($updateStatus = "finding out latest version...") do={ :set $updateStatus "incomplete" }
|
||||
|
||||
:if ($updateStatus = "New version is available" ) do={ }
|
||||
:if ($updateStatus = "System is already up to date" ) do={ }
|
||||
|
||||
} while=( $updateStatus = "incomplete" )
|
||||
: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 ( $updateStatus = "New version is available" ) do={
|
||||
:if ( $versionStatus = "New version is available" ) do={
|
||||
# alternative method
|
||||
# :if ( installedVersion != $latestVersion ) do={
|
||||
:log info "A new update is available for Router OS."
|
||||
|
|
@ -16,20 +16,29 @@
|
|||
/system package update
|
||||
check-for-updates once
|
||||
|
||||
:local updateStatus "incomplete"
|
||||
:do {
|
||||
:delay 3s
|
||||
:delay 2s
|
||||
|
||||
:set $versionStatus [get status]
|
||||
# alternative way to get the above info
|
||||
# :set $versionStatus ([print as-value]->"status")
|
||||
} while=( $versionStatus = "finding out latest version..." )
|
||||
:set $updateStatus [get status]
|
||||
|
||||
:if ($updateStatus = "ERROR: no internet connection") do={ :error "ERROT: no internet connection"; }
|
||||
:if ($updateStatus = "ERROR: connection timed out") do={ :error "ERROR: connection timed out"; }
|
||||
|
||||
:if ($updateStatus = "getting changelog...") do={ :set $updateStatus "incomplete" }
|
||||
:if ($updateStatus = "finding out latest version...") do={ :set $updateStatus "incomplete" }
|
||||
|
||||
:if ($updateStatus = "New version is available" ) do={ }
|
||||
:if ($updateStatus = "System is already up to date" ) do={ }
|
||||
|
||||
} while=( $updateStatus = "incomplete" )
|
||||
|
||||
:local installedVersion [get installed-version]
|
||||
:local latestVersion [get latest-version]
|
||||
|
||||
:if ( $versionStatus = "New version is available" ) do={
|
||||
# alternative method
|
||||
# :if ( installedVersion != $latestVersion ) do={
|
||||
# :if ( $updateStatus = "New version is available" ) do={
|
||||
: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" \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue