mirror of
https://git.eworm.de/cgit/routeros-scripts
synced 2025-06-20 17:05:44 +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 FetchUserAgentStr;
|
||||
:global LogPrint;
|
||||
:global RebootForUpdate;
|
||||
:global ScriptFromTerminal;
|
||||
:global ScriptLock;
|
||||
:global SendNotification2;
|
||||
|
@ -62,9 +63,14 @@
|
|||
$WaitFullyConnected;
|
||||
|
||||
:if ([ :len [ /system/scheduler/find where name="_RebootForUpdate" ] ] > 0) do={
|
||||
$LogPrint info $ScriptName ("A reboot for update is already scheduled.");
|
||||
:set ExitOK true;
|
||||
:error false;
|
||||
: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.");
|
||||
:set ExitOK true;
|
||||
:error false;
|
||||
}
|
||||
}
|
||||
|
||||
$LogPrint debug $ScriptName ("Checking for updates...");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue