aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2021-02-25 16:31:19 +0100
committerGravatar Christian Hesse <mail@eworm.de>2021-02-25 16:31:19 +0100
commitd0cdad791c937c48fe3598338599f678f1cd1e0d (patch)
tree7c3ce37886742651364e38a5a717a003a3fd0eda
parentfe3d582c1f68a995db9a25ec0e41545b2c8fd3d4 (diff)
global-functions: $ScriptInstallUpdate: swap conditions
-rw-r--r--global-functions9
1 files changed, 5 insertions, 4 deletions
diff --git a/global-functions b/global-functions
index 4b495d9..7dddb50 100644
--- a/global-functions
+++ b/global-functions
@@ -668,8 +668,8 @@
}
:if ([ :len $SourceNew ] > 0) do={
- :if ([ :pick $SourceNew 0 18 ] = "#!rsc by RouterOS\n") do={
- :if ($SourceNew != $ScriptVal->"source") do={
+ :if ($SourceNew != $ScriptVal->"source") do={
+ :if ([ :pick $SourceNew 0 18 ] = "#!rsc by RouterOS\n") do={
:local DontRequirePermissions \
($SourceNew~"\n# requires: dont-require-permissions=yes\n");
$LogPrintExit2 info $0 ("Updating script: " . $ScriptVal->"name") false;
@@ -692,10 +692,11 @@
}
}
} else={
- $LogPrintExit2 debug $0 ("Script " . $ScriptVal->"name" . " did not change.") false;
+ $LogPrintExit2 warning $0 ("Looks like new script " . $ScriptVal->"name" . \
+ " is not valid (missing shebang). Ignoring!") false;
}
} else={
- $LogPrintExit2 warning $0 ("Looks like new script " . $ScriptVal->"name" . " is not valid. Ignoring!") false;
+ $LogPrintExit2 debug $0 ("Script " . $ScriptVal->"name" . " did not change.") false;
}
} else={
$LogPrintExit2 debug $0 ("No update for script " . $ScriptVal->"name" . ".") false;