mirror of
https://github.com/laspavel/mikrotik-scripts.git
synced 2025-07-14 00:24:32 +02:00
Add new scripts. 06.12.2020
This commit is contained in:
parent
4705b8aa67
commit
f261bde503
6 changed files with 41 additions and 2 deletions
|
@ -1,12 +1,20 @@
|
|||
|
||||
:do {
|
||||
:local DeviceName [/system identity get name];
|
||||
:local versioninfo [/system package update check-for-updates as-value]
|
||||
:if (($versioninfo->"installed-version") != ($versioninfo->"latest-version")) do={
|
||||
/log error ("Found new version " . ($versioninfo->"latest-version") . " installing now!")
|
||||
/log info ("Found new firmware version " . ($versioninfo->"latest-version") . " installing now!")
|
||||
|
||||
:local MessageText ("<b>AutoUpdate $DeviceName:</b> Found new firmware version ". ($versioninfo->"latest-version") . ". Installing now!");
|
||||
:local SendTelegramMessage [:parse [/system script get SendTelegram source]];
|
||||
$SendTelegramMessage MessageText=$MessageText;
|
||||
|
||||
/system package update download
|
||||
|
||||
:delay 5s
|
||||
/system reboot
|
||||
}
|
||||
/log info ("Installed firmware version: " .($versioninfo->"installed-version"))
|
||||
|
||||
} on-error={
|
||||
/log error "***** AUTOUPDATE script finished with error ******"
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue