diff options
author | Christian Hesse <mail@eworm.de> | 2024-03-08 12:45:37 +0100 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2024-03-12 20:37:57 +0100 |
commit | e40da1e7e483a07592477ef82c4a665f6b2a7bde (patch) | |
tree | f94d818c0a600f0c19a062a1c8bdf4e6f599c174 | |
parent | ca822e1358d59f43d2ef359e2ec3cde44c589f46 (diff) |
capsman-download-packages: switch to $LogPrint
-rw-r--r-- | capsman-download-packages.capsman.rsc | 16 | ||||
-rw-r--r-- | capsman-download-packages.template.rsc | 16 | ||||
-rw-r--r-- | capsman-download-packages.wifi.rsc | 16 |
3 files changed, 27 insertions, 21 deletions
diff --git a/capsman-download-packages.capsman.rsc b/capsman-download-packages.capsman.rsc index d4e900d..a3bd4a5 100644 --- a/capsman-download-packages.capsman.rsc +++ b/capsman-download-packages.capsman.rsc @@ -19,7 +19,7 @@ :global CleanFilePath; :global DownloadPackage; - :global LogPrintExit2; + :global LogPrint; :global MkDir; :global ScriptLock; :global WaitFullyConnected; @@ -34,16 +34,18 @@ :local Updated false; :if ([ :len $PackagePath ] = 0) do={ - $LogPrintExit2 warning $ScriptName ("The CAPsMAN package path is not defined, can not download packages.") true; + $LogPrint warning $ScriptName ("The CAPsMAN package path is not defined, can not download packages."); + :error false; } :if ([ :len [ /file/find where name=$PackagePath type="directory" ] ] = 0) do={ :if ([ $MkDir $PackagePath ] = false) do={ - $LogPrintExit2 warning $ScriptName ("Creating directory at CAPsMAN package path (" . \ - $PackagePath . ") failed!") true; + $LogPrint warning $ScriptName ("Creating directory at CAPsMAN package path (" . \ + $PackagePath . ") failed!"); + :error false; } - $LogPrintExit2 info $ScriptName ("Created directory at CAPsMAN package path (" . $PackagePath . \ - "). Please place your packages!") false; + $LogPrint info $ScriptName ("Created directory at CAPsMAN package path (" . $PackagePath . \ + "). Please place your packages!"); } :foreach Package in=[ /file/find where type=package \ @@ -60,7 +62,7 @@ } :if ([ :len [ /file/find where type=package name~("^" . $PackagePath) ] ] = 0) do={ - $LogPrintExit2 info $ScriptName ("No packages available, downloading default set.") false; + $LogPrint info $ScriptName ("No packages available, downloading default set."); :foreach Arch in={ "arm"; "mipsbe" } do={ :foreach Package in={ "routeros"; "wireless" } do={ :if ([ $DownloadPackage $Package $InstalledVersion $Arch $PackagePath ] = true) do={ diff --git a/capsman-download-packages.template.rsc b/capsman-download-packages.template.rsc index cd4a83b..cad3bcb 100644 --- a/capsman-download-packages.template.rsc +++ b/capsman-download-packages.template.rsc @@ -20,7 +20,7 @@ :global CleanFilePath; :global DownloadPackage; - :global LogPrintExit2; + :global LogPrint; :global MkDir; :global ScriptLock; :global WaitFullyConnected; @@ -36,16 +36,18 @@ :local Updated false; :if ([ :len $PackagePath ] = 0) do={ - $LogPrintExit2 warning $ScriptName ("The CAPsMAN package path is not defined, can not download packages.") true; + $LogPrint warning $ScriptName ("The CAPsMAN package path is not defined, can not download packages."); + :error false; } :if ([ :len [ /file/find where name=$PackagePath type="directory" ] ] = 0) do={ :if ([ $MkDir $PackagePath ] = false) do={ - $LogPrintExit2 warning $ScriptName ("Creating directory at CAPsMAN package path (" . \ - $PackagePath . ") failed!") true; + $LogPrint warning $ScriptName ("Creating directory at CAPsMAN package path (" . \ + $PackagePath . ") failed!"); + :error false; } - $LogPrintExit2 info $ScriptName ("Created directory at CAPsMAN package path (" . $PackagePath . \ - "). Please place your packages!") false; + $LogPrint info $ScriptName ("Created directory at CAPsMAN package path (" . $PackagePath . \ + "). Please place your packages!"); } :foreach Package in=[ /file/find where type=package \ @@ -62,7 +64,7 @@ } :if ([ :len [ /file/find where type=package name~("^" . $PackagePath) ] ] = 0) do={ - $LogPrintExit2 info $ScriptName ("No packages available, downloading default set.") false; + $LogPrint info $ScriptName ("No packages available, downloading default set."); # NOT /interface/wifi/ # :foreach Arch in={ "arm"; "mipsbe" } do={ :foreach Package in={ "routeros"; "wireless" } do={ diff --git a/capsman-download-packages.wifi.rsc b/capsman-download-packages.wifi.rsc index 633830a..909688f 100644 --- a/capsman-download-packages.wifi.rsc +++ b/capsman-download-packages.wifi.rsc @@ -19,7 +19,7 @@ :global CleanFilePath; :global DownloadPackage; - :global LogPrintExit2; + :global LogPrint; :global MkDir; :global ScriptLock; :global WaitFullyConnected; @@ -34,16 +34,18 @@ :local Updated false; :if ([ :len $PackagePath ] = 0) do={ - $LogPrintExit2 warning $ScriptName ("The CAPsMAN package path is not defined, can not download packages.") true; + $LogPrint warning $ScriptName ("The CAPsMAN package path is not defined, can not download packages."); + :error false; } :if ([ :len [ /file/find where name=$PackagePath type="directory" ] ] = 0) do={ :if ([ $MkDir $PackagePath ] = false) do={ - $LogPrintExit2 warning $ScriptName ("Creating directory at CAPsMAN package path (" . \ - $PackagePath . ") failed!") true; + $LogPrint warning $ScriptName ("Creating directory at CAPsMAN package path (" . \ + $PackagePath . ") failed!"); + :error false; } - $LogPrintExit2 info $ScriptName ("Created directory at CAPsMAN package path (" . $PackagePath . \ - "). Please place your packages!") false; + $LogPrint info $ScriptName ("Created directory at CAPsMAN package path (" . $PackagePath . \ + "). Please place your packages!"); } :foreach Package in=[ /file/find where type=package \ @@ -60,7 +62,7 @@ } :if ([ :len [ /file/find where type=package name~("^" . $PackagePath) ] ] = 0) do={ - $LogPrintExit2 info $ScriptName ("No packages available, downloading default set.") false; + $LogPrint info $ScriptName ("No packages available, downloading default set."); :foreach Arch in={ "arm"; "arm64" } do={ :local Packages { "arm"={ "routeros"; "wifi-qcom"; "wifi-qcom-ac" }; "arm64"={ "routeros"; "wifi-qcom" } }; |