mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2026-04-16 18:19:36 +00:00
capsman-download-packages: early exit with :exit
This commit is contained in:
parent
65d6044793
commit
d52feb86f6
4 changed files with 16 additions and 28 deletions
|
|
@ -4,14 +4,13 @@
|
||||||
# Michael Gisbers <michael@gisbers.de>
|
# Michael Gisbers <michael@gisbers.de>
|
||||||
# https://rsc.eworm.de/COPYING.md
|
# https://rsc.eworm.de/COPYING.md
|
||||||
#
|
#
|
||||||
# requires RouterOS, version=7.19
|
# requires RouterOS, version=7.22
|
||||||
#
|
#
|
||||||
# download and cleanup packages for CAP installation from CAPsMAN
|
# download and cleanup packages for CAP installation from CAPsMAN
|
||||||
# https://rsc.eworm.de/doc/capsman-download-packages.md
|
# https://rsc.eworm.de/doc/capsman-download-packages.md
|
||||||
#
|
#
|
||||||
# !! Do not edit this file, it is generated from template!
|
# !! Do not edit this file, it is generated from template!
|
||||||
|
|
||||||
:local ExitOK false;
|
|
||||||
:onerror Err {
|
:onerror Err {
|
||||||
:global GlobalConfigReady; :global GlobalFunctionsReady;
|
:global GlobalConfigReady; :global GlobalFunctionsReady;
|
||||||
:retry { :if ($GlobalConfigReady != true || $GlobalFunctionsReady != true) \
|
:retry { :if ($GlobalConfigReady != true || $GlobalFunctionsReady != true) \
|
||||||
|
|
@ -28,8 +27,7 @@
|
||||||
:global WaitFullyConnected;
|
:global WaitFullyConnected;
|
||||||
|
|
||||||
:if ([ $ScriptLock $ScriptName ] = false) do={
|
:if ([ $ScriptLock $ScriptName ] = false) do={
|
||||||
:set ExitOK true;
|
:exit;
|
||||||
:error false;
|
|
||||||
}
|
}
|
||||||
$WaitFullyConnected;
|
$WaitFullyConnected;
|
||||||
|
|
||||||
|
|
@ -39,16 +37,14 @@
|
||||||
|
|
||||||
:if ([ :len $PackagePath ] = 0) do={
|
:if ([ :len $PackagePath ] = 0) do={
|
||||||
$LogPrint warning $ScriptName ("The CAPsMAN package path is not defined, can not download packages.");
|
$LogPrint warning $ScriptName ("The CAPsMAN package path is not defined, can not download packages.");
|
||||||
:set ExitOK true;
|
:exit;
|
||||||
:error false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
:if ([ $FileGet $PackagePath ] = false) do={
|
:if ([ $FileGet $PackagePath ] = false) do={
|
||||||
:if ([ $MkDir $PackagePath ] = false) do={
|
:if ([ $MkDir $PackagePath ] = false) do={
|
||||||
$LogPrint warning $ScriptName ("Creating directory at CAPsMAN package path (" . \
|
$LogPrint warning $ScriptName ("Creating directory at CAPsMAN package path (" . \
|
||||||
$PackagePath . ") failed!");
|
$PackagePath . ") failed!");
|
||||||
:set ExitOK true;
|
:exit;
|
||||||
:error false;
|
|
||||||
}
|
}
|
||||||
$LogPrint info $ScriptName ("Created directory at CAPsMAN package path (" . $PackagePath . \
|
$LogPrint info $ScriptName ("Created directory at CAPsMAN package path (" . $PackagePath . \
|
||||||
"). Please place your packages!");
|
"). Please place your packages!");
|
||||||
|
|
@ -89,5 +85,5 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} do={
|
} do={
|
||||||
:global ExitError; $ExitError $ExitOK [ :jobname ] $Err;
|
:global ExitOnError; $ExitOnError [ :jobname ] $Err;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
# Michael Gisbers <michael@gisbers.de>
|
# Michael Gisbers <michael@gisbers.de>
|
||||||
# https://rsc.eworm.de/COPYING.md
|
# https://rsc.eworm.de/COPYING.md
|
||||||
#
|
#
|
||||||
# requires RouterOS, version=7.19
|
# requires RouterOS, version=7.22
|
||||||
#
|
#
|
||||||
# download and cleanup packages for CAP installation from CAPsMAN
|
# download and cleanup packages for CAP installation from CAPsMAN
|
||||||
# https://rsc.eworm.de/doc/capsman-download-packages.md
|
# https://rsc.eworm.de/doc/capsman-download-packages.md
|
||||||
|
|
@ -12,7 +12,6 @@
|
||||||
# !! This is just a template to generate the real script!
|
# !! This is just a template to generate the real script!
|
||||||
# !! Pattern '%TEMPL%' is replaced, paths are filtered.
|
# !! Pattern '%TEMPL%' is replaced, paths are filtered.
|
||||||
|
|
||||||
:local ExitOK false;
|
|
||||||
:onerror Err {
|
:onerror Err {
|
||||||
:global GlobalConfigReady; :global GlobalFunctionsReady;
|
:global GlobalConfigReady; :global GlobalFunctionsReady;
|
||||||
:retry { :if ($GlobalConfigReady != true || $GlobalFunctionsReady != true) \
|
:retry { :if ($GlobalConfigReady != true || $GlobalFunctionsReady != true) \
|
||||||
|
|
@ -29,8 +28,7 @@
|
||||||
:global WaitFullyConnected;
|
:global WaitFullyConnected;
|
||||||
|
|
||||||
:if ([ $ScriptLock $ScriptName ] = false) do={
|
:if ([ $ScriptLock $ScriptName ] = false) do={
|
||||||
:set ExitOK true;
|
:exit;
|
||||||
:error false;
|
|
||||||
}
|
}
|
||||||
$WaitFullyConnected;
|
$WaitFullyConnected;
|
||||||
|
|
||||||
|
|
@ -41,16 +39,14 @@
|
||||||
|
|
||||||
:if ([ :len $PackagePath ] = 0) do={
|
:if ([ :len $PackagePath ] = 0) do={
|
||||||
$LogPrint warning $ScriptName ("The CAPsMAN package path is not defined, can not download packages.");
|
$LogPrint warning $ScriptName ("The CAPsMAN package path is not defined, can not download packages.");
|
||||||
:set ExitOK true;
|
:exit;
|
||||||
:error false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
:if ([ $FileGet $PackagePath ] = false) do={
|
:if ([ $FileGet $PackagePath ] = false) do={
|
||||||
:if ([ $MkDir $PackagePath ] = false) do={
|
:if ([ $MkDir $PackagePath ] = false) do={
|
||||||
$LogPrint warning $ScriptName ("Creating directory at CAPsMAN package path (" . \
|
$LogPrint warning $ScriptName ("Creating directory at CAPsMAN package path (" . \
|
||||||
$PackagePath . ") failed!");
|
$PackagePath . ") failed!");
|
||||||
:set ExitOK true;
|
:exit;
|
||||||
:error false;
|
|
||||||
}
|
}
|
||||||
$LogPrint info $ScriptName ("Created directory at CAPsMAN package path (" . $PackagePath . \
|
$LogPrint info $ScriptName ("Created directory at CAPsMAN package path (" . $PackagePath . \
|
||||||
"). Please place your packages!");
|
"). Please place your packages!");
|
||||||
|
|
@ -100,5 +96,5 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} do={
|
} do={
|
||||||
:global ExitError; $ExitError $ExitOK [ :jobname ] $Err;
|
:global ExitOnError; $ExitOnError [ :jobname ] $Err;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,14 +4,13 @@
|
||||||
# Michael Gisbers <michael@gisbers.de>
|
# Michael Gisbers <michael@gisbers.de>
|
||||||
# https://rsc.eworm.de/COPYING.md
|
# https://rsc.eworm.de/COPYING.md
|
||||||
#
|
#
|
||||||
# requires RouterOS, version=7.19
|
# requires RouterOS, version=7.22
|
||||||
#
|
#
|
||||||
# download and cleanup packages for CAP installation from CAPsMAN
|
# download and cleanup packages for CAP installation from CAPsMAN
|
||||||
# https://rsc.eworm.de/doc/capsman-download-packages.md
|
# https://rsc.eworm.de/doc/capsman-download-packages.md
|
||||||
#
|
#
|
||||||
# !! Do not edit this file, it is generated from template!
|
# !! Do not edit this file, it is generated from template!
|
||||||
|
|
||||||
:local ExitOK false;
|
|
||||||
:onerror Err {
|
:onerror Err {
|
||||||
:global GlobalConfigReady; :global GlobalFunctionsReady;
|
:global GlobalConfigReady; :global GlobalFunctionsReady;
|
||||||
:retry { :if ($GlobalConfigReady != true || $GlobalFunctionsReady != true) \
|
:retry { :if ($GlobalConfigReady != true || $GlobalFunctionsReady != true) \
|
||||||
|
|
@ -28,8 +27,7 @@
|
||||||
:global WaitFullyConnected;
|
:global WaitFullyConnected;
|
||||||
|
|
||||||
:if ([ $ScriptLock $ScriptName ] = false) do={
|
:if ([ $ScriptLock $ScriptName ] = false) do={
|
||||||
:set ExitOK true;
|
:exit;
|
||||||
:error false;
|
|
||||||
}
|
}
|
||||||
$WaitFullyConnected;
|
$WaitFullyConnected;
|
||||||
|
|
||||||
|
|
@ -39,16 +37,14 @@
|
||||||
|
|
||||||
:if ([ :len $PackagePath ] = 0) do={
|
:if ([ :len $PackagePath ] = 0) do={
|
||||||
$LogPrint warning $ScriptName ("The CAPsMAN package path is not defined, can not download packages.");
|
$LogPrint warning $ScriptName ("The CAPsMAN package path is not defined, can not download packages.");
|
||||||
:set ExitOK true;
|
:exit;
|
||||||
:error false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
:if ([ $FileGet $PackagePath ] = false) do={
|
:if ([ $FileGet $PackagePath ] = false) do={
|
||||||
:if ([ $MkDir $PackagePath ] = false) do={
|
:if ([ $MkDir $PackagePath ] = false) do={
|
||||||
$LogPrint warning $ScriptName ("Creating directory at CAPsMAN package path (" . \
|
$LogPrint warning $ScriptName ("Creating directory at CAPsMAN package path (" . \
|
||||||
$PackagePath . ") failed!");
|
$PackagePath . ") failed!");
|
||||||
:set ExitOK true;
|
:exit;
|
||||||
:error false;
|
|
||||||
}
|
}
|
||||||
$LogPrint info $ScriptName ("Created directory at CAPsMAN package path (" . $PackagePath . \
|
$LogPrint info $ScriptName ("Created directory at CAPsMAN package path (" . $PackagePath . \
|
||||||
"). Please place your packages!");
|
"). Please place your packages!");
|
||||||
|
|
@ -91,5 +87,5 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} do={
|
} do={
|
||||||
:global ExitError; $ExitError $ExitOK [ :jobname ] $Err;
|
:global ExitOnError; $ExitOnError [ :jobname ] $Err;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ Download packages for CAP upgrade from CAPsMAN
|
||||||
[](https://github.com/eworm-de/routeros-scripts/stargazers)
|
[](https://github.com/eworm-de/routeros-scripts/stargazers)
|
||||||
[](https://github.com/eworm-de/routeros-scripts/network)
|
[](https://github.com/eworm-de/routeros-scripts/network)
|
||||||
[](https://github.com/eworm-de/routeros-scripts/watchers)
|
[](https://github.com/eworm-de/routeros-scripts/watchers)
|
||||||
[](https://mikrotik.com/download/changelogs/)
|
[](https://mikrotik.com/download/changelogs/)
|
||||||
[](https://t.me/routeros_scripts)
|
[](https://t.me/routeros_scripts)
|
||||||
[](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=A4ZXBD6YS2W8J)
|
[](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=A4ZXBD6YS2W8J)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue