mirror of
https://github.com/pothi/mikrotik-scripts.git
synced 2026-01-21 00:29: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
|
/system package update
|
||||||
check-for-updates once
|
check-for-updates once
|
||||||
|
|
||||||
:local updateStatus "incomplete"
|
|
||||||
:do {
|
:do {
|
||||||
:delay 2s
|
:delay 3s
|
||||||
|
|
||||||
:set $updateStatus [get status]
|
:set $versionStatus [get status]
|
||||||
|
# alternative way to get the above info
|
||||||
:if ($updateStatus = "ERROR: no internet connection") do={ :error "ERROT: no internet connection"; }
|
# :set $versionStatus ([print as-value]->"status")
|
||||||
:if ($updateStatus = "ERROR: connection timed out") do={ :error "ERROR: connection timed out"; }
|
} while=( $versionStatus = "finding out latest version..." )
|
||||||
|
|
||||||
: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 installedVersion [get installed-version]
|
||||||
:local latestVersion [get latest-version]
|
:local latestVersion [get latest-version]
|
||||||
|
|
||||||
:if ( $updateStatus = "New version is available" ) do={
|
:if ( $versionStatus = "New version is available" ) do={
|
||||||
# alternative method
|
# alternative method
|
||||||
# :if ( installedVersion != $latestVersion ) do={
|
# :if ( installedVersion != $latestVersion ) do={
|
||||||
:log info "A new update is available for Router OS."
|
:log info "A new update is available for Router OS."
|
||||||
|
|
@ -16,20 +16,29 @@
|
||||||
/system package update
|
/system package update
|
||||||
check-for-updates once
|
check-for-updates once
|
||||||
|
|
||||||
|
:local updateStatus "incomplete"
|
||||||
:do {
|
:do {
|
||||||
:delay 3s
|
:delay 2s
|
||||||
|
|
||||||
:set $versionStatus [get status]
|
:set $updateStatus [get status]
|
||||||
# alternative way to get the above info
|
|
||||||
# :set $versionStatus ([print as-value]->"status")
|
:if ($updateStatus = "ERROR: no internet connection") do={ :error "ERROT: no internet connection"; }
|
||||||
} while=( $versionStatus = "finding out latest version..." )
|
: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 installedVersion [get installed-version]
|
||||||
:local latestVersion [get latest-version]
|
:local latestVersion [get latest-version]
|
||||||
|
|
||||||
:if ( $versionStatus = "New version is available" ) do={
|
|
||||||
# alternative method
|
# 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."
|
:log info "A new update is available for Router OS."
|
||||||
/tool e-mail send to="$adminEmail" \
|
/tool e-mail send to="$adminEmail" \
|
||||||
subject="Software Update is Available" \
|
subject="Software Update is Available" \
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue