mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2026-01-20 16:09:32 +00:00
capsman-download-packages: early exit with :exit
This commit is contained in:
parent
98bd011984
commit
85965a6dee
3 changed files with 12 additions and 24 deletions
|
|
@ -11,7 +11,6 @@
|
|||
#
|
||||
# !! Do not edit this file, it is generated from template!
|
||||
|
||||
:local ExitOK false;
|
||||
:onerror Err {
|
||||
:global GlobalConfigReady; :global GlobalFunctionsReady;
|
||||
:retry { :if ($GlobalConfigReady != true || $GlobalFunctionsReady != true) \
|
||||
|
|
@ -28,8 +27,7 @@
|
|||
:global WaitFullyConnected;
|
||||
|
||||
:if ([ $ScriptLock $ScriptName ] = false) do={
|
||||
:set ExitOK true;
|
||||
:error false;
|
||||
:exit;
|
||||
}
|
||||
$WaitFullyConnected;
|
||||
|
||||
|
|
@ -39,16 +37,14 @@
|
|||
|
||||
:if ([ :len $PackagePath ] = 0) do={
|
||||
$LogPrint warning $ScriptName ("The CAPsMAN package path is not defined, can not download packages.");
|
||||
:set ExitOK true;
|
||||
:error false;
|
||||
:exit;
|
||||
}
|
||||
|
||||
:if ([ $FileGet $PackagePath ] = false) do={
|
||||
:if ([ $MkDir $PackagePath ] = false) do={
|
||||
$LogPrint warning $ScriptName ("Creating directory at CAPsMAN package path (" . \
|
||||
$PackagePath . ") failed!");
|
||||
:set ExitOK true;
|
||||
:error false;
|
||||
:exit;
|
||||
}
|
||||
$LogPrint info $ScriptName ("Created directory at CAPsMAN package path (" . $PackagePath . \
|
||||
"). Please place your packages!");
|
||||
|
|
@ -89,5 +85,5 @@
|
|||
}
|
||||
}
|
||||
} do={
|
||||
:global ExitError; $ExitError $ExitOK [ :jobname ] $Err;
|
||||
:global ExitError; $ExitError false [ :jobname ] $Err;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,7 +12,6 @@
|
|||
# !! This is just a template to generate the real script!
|
||||
# !! Pattern '%TEMPL%' is replaced, paths are filtered.
|
||||
|
||||
:local ExitOK false;
|
||||
:onerror Err {
|
||||
:global GlobalConfigReady; :global GlobalFunctionsReady;
|
||||
:retry { :if ($GlobalConfigReady != true || $GlobalFunctionsReady != true) \
|
||||
|
|
@ -29,8 +28,7 @@
|
|||
:global WaitFullyConnected;
|
||||
|
||||
:if ([ $ScriptLock $ScriptName ] = false) do={
|
||||
:set ExitOK true;
|
||||
:error false;
|
||||
:exit;
|
||||
}
|
||||
$WaitFullyConnected;
|
||||
|
||||
|
|
@ -41,16 +39,14 @@
|
|||
|
||||
:if ([ :len $PackagePath ] = 0) do={
|
||||
$LogPrint warning $ScriptName ("The CAPsMAN package path is not defined, can not download packages.");
|
||||
:set ExitOK true;
|
||||
:error false;
|
||||
:exit;
|
||||
}
|
||||
|
||||
:if ([ $FileGet $PackagePath ] = false) do={
|
||||
:if ([ $MkDir $PackagePath ] = false) do={
|
||||
$LogPrint warning $ScriptName ("Creating directory at CAPsMAN package path (" . \
|
||||
$PackagePath . ") failed!");
|
||||
:set ExitOK true;
|
||||
:error false;
|
||||
:exit;
|
||||
}
|
||||
$LogPrint info $ScriptName ("Created directory at CAPsMAN package path (" . $PackagePath . \
|
||||
"). Please place your packages!");
|
||||
|
|
@ -100,5 +96,5 @@
|
|||
}
|
||||
}
|
||||
} do={
|
||||
:global ExitError; $ExitError $ExitOK [ :jobname ] $Err;
|
||||
:global ExitError; $ExitError false [ :jobname ] $Err;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,7 +11,6 @@
|
|||
#
|
||||
# !! Do not edit this file, it is generated from template!
|
||||
|
||||
:local ExitOK false;
|
||||
:onerror Err {
|
||||
:global GlobalConfigReady; :global GlobalFunctionsReady;
|
||||
:retry { :if ($GlobalConfigReady != true || $GlobalFunctionsReady != true) \
|
||||
|
|
@ -28,8 +27,7 @@
|
|||
:global WaitFullyConnected;
|
||||
|
||||
:if ([ $ScriptLock $ScriptName ] = false) do={
|
||||
:set ExitOK true;
|
||||
:error false;
|
||||
:exit;
|
||||
}
|
||||
$WaitFullyConnected;
|
||||
|
||||
|
|
@ -39,16 +37,14 @@
|
|||
|
||||
:if ([ :len $PackagePath ] = 0) do={
|
||||
$LogPrint warning $ScriptName ("The CAPsMAN package path is not defined, can not download packages.");
|
||||
:set ExitOK true;
|
||||
:error false;
|
||||
:exit;
|
||||
}
|
||||
|
||||
:if ([ $FileGet $PackagePath ] = false) do={
|
||||
:if ([ $MkDir $PackagePath ] = false) do={
|
||||
$LogPrint warning $ScriptName ("Creating directory at CAPsMAN package path (" . \
|
||||
$PackagePath . ") failed!");
|
||||
:set ExitOK true;
|
||||
:error false;
|
||||
:exit;
|
||||
}
|
||||
$LogPrint info $ScriptName ("Created directory at CAPsMAN package path (" . $PackagePath . \
|
||||
"). Please place your packages!");
|
||||
|
|
@ -91,5 +87,5 @@
|
|||
}
|
||||
}
|
||||
} do={
|
||||
:global ExitError; $ExitError $ExitOK [ :jobname ] $Err;
|
||||
:global ExitError; $ExitError false [ :jobname ] $Err;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue