Better naming

This commit is contained in:
Pothi Kalimuthu 2025-12-15 10:39:16 +05:30
parent 326ac64fc9
commit 4fb9a237f8
No known key found for this signature in database
GPG key ID: 57069303D36E3093
2 changed files with 22 additions and 22 deletions

View file

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

View file

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