Add new scripts. 06.12.2020

This commit is contained in:
laspavel 2021-01-06 13:25:08 +02:00
parent 4705b8aa67
commit f261bde503
6 changed files with 41 additions and 2 deletions

View file

@ -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 ******"
}