mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2026-04-21 12:39:36 +00:00
Compare commits
2 commits
7462b0b1f0
...
9f6ade4fe4
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9f6ade4fe4 | ||
|
|
5f60c2b01c |
2 changed files with 19 additions and 22 deletions
|
|
@ -272,7 +272,9 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
# load custom settings from overlay and snippets
|
# load custom settings from overlay and snippets
|
||||||
# Warning: Do *NOT* copy this code to overlay!
|
# /\ Warning: Do *NOT*
|
||||||
|
# /\7\ copy this code
|
||||||
|
# /_()_\ to overlay!
|
||||||
:foreach Script in=([ /system/script/find where name="global-config-overlay" ], \
|
:foreach Script in=([ /system/script/find where name="global-config-overlay" ], \
|
||||||
[ /system/script/find where name~"^global-config-overlay.d/" ]) do={
|
[ /system/script/find where name~"^global-config-overlay.d/" ]) do={
|
||||||
:do {
|
:do {
|
||||||
|
|
|
||||||
|
|
@ -1126,6 +1126,8 @@
|
||||||
:global CommitId;
|
:global CommitId;
|
||||||
:global CommitInfo;
|
:global CommitInfo;
|
||||||
:global ExpectedConfigVersion;
|
:global ExpectedConfigVersion;
|
||||||
|
:global GlobalConfigReady;
|
||||||
|
:global GlobalFunctionsReady;
|
||||||
:global Identity;
|
:global Identity;
|
||||||
:global IDonate;
|
:global IDonate;
|
||||||
:global NoNewsAndChangesNotification;
|
:global NoNewsAndChangesNotification;
|
||||||
|
|
@ -1159,8 +1161,7 @@
|
||||||
|
|
||||||
:local CommitIdBefore $CommitId;
|
:local CommitIdBefore $CommitId;
|
||||||
:local ExpectedConfigVersionBefore $ExpectedConfigVersion;
|
:local ExpectedConfigVersionBefore $ExpectedConfigVersion;
|
||||||
:local ReloadGlobalFunctions false;
|
:local ReloadGlobal false;
|
||||||
:local ReloadGlobalConfig false;
|
|
||||||
:local DeviceMode [ /system/device-mode/get ];
|
:local DeviceMode [ /system/device-mode/get ];
|
||||||
|
|
||||||
:local CheckSums ({});
|
:local CheckSums ({});
|
||||||
|
|
@ -1269,31 +1270,25 @@
|
||||||
$LogPrint info $0 ("Updating script: " . $ScriptVal->"name");
|
$LogPrint info $0 ("Updating script: " . $ScriptVal->"name");
|
||||||
/system/script/set owner=($ScriptVal->"name") \
|
/system/script/set owner=($ScriptVal->"name") \
|
||||||
source=[ $IfThenElse ($ScriptUpdatesCRLF = true) $SourceCRLF $SourceNew ] $Script;
|
source=[ $IfThenElse ($ScriptUpdatesCRLF = true) $SourceCRLF $SourceNew ] $Script;
|
||||||
:if ($ScriptVal->"name" = "global-config") do={
|
:if ($ScriptVal->"name" = "global-config" || \
|
||||||
:set ReloadGlobalConfig true;
|
$ScriptVal->"name" = "global-functions" || \
|
||||||
}
|
$ScriptVal->"name" ~ ("^mod/.")) do={
|
||||||
:if ($ScriptVal->"name" = "global-functions" || $ScriptVal->"name" ~ ("^mod/.")) do={
|
:set ReloadGlobal true;
|
||||||
:set ReloadGlobalFunctions true;
|
|
||||||
}
|
}
|
||||||
} on-error={ }
|
} on-error={ }
|
||||||
}
|
}
|
||||||
|
|
||||||
:if ($ReloadGlobalFunctions = true) do={
|
:if ($ReloadGlobal = true) do={
|
||||||
$LogPrint info $0 ("Reloading global functions.");
|
$LogPrint info $0 ("Reloading global configuration and functions.");
|
||||||
:do {
|
:set GlobalConfigReady false;
|
||||||
/system/script/run global-functions;
|
:set GlobalFunctionsReady false;
|
||||||
} on-error={
|
:delay 1s;
|
||||||
$LogPrint error $0 ("Reloading global functions failed!");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
:if ($ReloadGlobalConfig = true) do={
|
:onerror Err {
|
||||||
$LogPrint info $0 ("Reloading global configuration.");
|
|
||||||
:do {
|
|
||||||
/system/script/run global-config;
|
/system/script/run global-config;
|
||||||
} on-error={
|
/system/script/run global-functions;
|
||||||
$LogPrint error $0 ("Reloading global configuration failed!" . \
|
} do={
|
||||||
" Syntax error or missing overlay?");
|
$LogPrint error $0 ("Reloading global configuration and functions failed! " . $Err);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue