mirror of
https://git.eworm.de/cgit/routeros-scripts
synced 2025-06-21 01:15:42 +02:00
check-routeros-update: remove a stale scheduler
This commit is contained in:
parent
c3d3d61f92
commit
1f4bf9ee63
1 changed files with 9 additions and 3 deletions
|
@ -28,6 +28,7 @@
|
||||||
:global EscapeForRegEx;
|
:global EscapeForRegEx;
|
||||||
:global FetchUserAgentStr;
|
:global FetchUserAgentStr;
|
||||||
:global LogPrint;
|
:global LogPrint;
|
||||||
|
:global RebootForUpdate;
|
||||||
:global ScriptFromTerminal;
|
:global ScriptFromTerminal;
|
||||||
:global ScriptLock;
|
:global ScriptLock;
|
||||||
:global SendNotification2;
|
:global SendNotification2;
|
||||||
|
@ -62,10 +63,15 @@
|
||||||
$WaitFullyConnected;
|
$WaitFullyConnected;
|
||||||
|
|
||||||
:if ([ :len [ /system/scheduler/find where name="_RebootForUpdate" ] ] > 0) do={
|
:if ([ :len [ /system/scheduler/find where name="_RebootForUpdate" ] ] > 0) do={
|
||||||
|
:if ([ :typeof $RebootForUpdate ] = "nothing") do={
|
||||||
|
$LogPrint info $ScriptName ("Found a stale scheduler for reboot, removing.");
|
||||||
|
/system/scheduler/remove "_RebootForUpdate";
|
||||||
|
} else={
|
||||||
$LogPrint info $ScriptName ("A reboot for update is already scheduled.");
|
$LogPrint info $ScriptName ("A reboot for update is already scheduled.");
|
||||||
:set ExitOK true;
|
:set ExitOK true;
|
||||||
:error false;
|
:error false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$LogPrint debug $ScriptName ("Checking for updates...");
|
$LogPrint debug $ScriptName ("Checking for updates...");
|
||||||
/system/package/update/check-for-updates without-paging as-value;
|
/system/package/update/check-for-updates without-paging as-value;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue