mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2025-12-06 01:49:28 +00:00
Compare commits
2 commits
bebf0206fe
...
c80dd7d891
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c80dd7d891 | ||
|
|
1e65df49fb |
7 changed files with 23 additions and 7 deletions
|
|
@ -45,9 +45,6 @@ Run the complete base installation:
|
|||
};
|
||||
:put "Loading configuration and functions...";
|
||||
/system/script { run global-config; run global-functions; };
|
||||
:put "Scheduling to load configuration and functions...";
|
||||
/system/scheduler/remove [ find where name="global-scripts" ];
|
||||
/system/scheduler/add name="global-scripts" start-time=startup on-event="/system/script { run global-config; run global-functions; }";
|
||||
:if ([ :len [ /certificate/find where fingerprint=$CertFingerprint ] ] > 0) do={
|
||||
:put "Renaming certificate by its common-name...";
|
||||
:global CertificateNameByCN;
|
||||
|
|
|
|||
6
Makefile
6
Makefile
|
|
@ -12,7 +12,7 @@ DATE ?= $(shell date --rfc-email)
|
|||
VERSION ?= $(shell git symbolic-ref --short HEAD 2>/dev/null)/$(shell git rev-list --count HEAD 2>/dev/null)/$(shell git rev-parse --short=8 HEAD 2>/dev/null)
|
||||
export DATE VERSION
|
||||
|
||||
.PHONY: all checksums docs rsc clean
|
||||
.PHONY: all checksums commitinfo docs rsc clean
|
||||
|
||||
all: checksums docs rsc
|
||||
|
||||
|
|
@ -21,6 +21,10 @@ checksums: checksums.json
|
|||
checksums.json: contrib/checksums.sh $(ALL_RSC)
|
||||
contrib/checksums.sh > $@
|
||||
|
||||
commitinfo: global-functions.rsc
|
||||
contrib/commitinfo.sh $< > $<~
|
||||
mv $<~ $<
|
||||
|
||||
docs: $(HTML)
|
||||
|
||||
%.html: %.md general/style.css contrib/html.sh contrib/html.sh.d/head.html
|
||||
|
|
|
|||
Binary file not shown.
|
Before Width: | Height: | Size: 1.9 KiB |
BIN
README.d/05-run-scripts.avif
Normal file
BIN
README.d/05-run-scripts.avif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.8 KiB |
|
|
@ -129,12 +129,12 @@ Now let's download the main scripts and add them in configuration on the fly.
|
|||
|
||||

|
||||
|
||||
And finally load configuration and functions and add the scheduler.
|
||||
And finally run configuration and functions. This will also add the
|
||||
scheduler for loading at system startup automatically.
|
||||
|
||||
/system/script { run global-config; run global-functions; };
|
||||
/system/scheduler/add name="global-scripts" start-time=startup on-event="/system/script { run global-config; run global-functions; }";
|
||||
|
||||

|
||||

|
||||
|
||||
> 💡️ **Hint**: You see complaints regarding syntax errors? Most likely the
|
||||
> RouterOS on your device is too old. Check for updates!
|
||||
|
|
|
|||
6
contrib/commitinfo.sh
Executable file
6
contrib/commitinfo.sh
Executable file
|
|
@ -0,0 +1,6 @@
|
|||
#!/bin/sh
|
||||
|
||||
sed \
|
||||
-e "/^:global CommitId/c :global CommitId \"${COMMITID:-unknown}\";" \
|
||||
-e "/^:global CommitInfo/c :global CommitInfo \"${COMMITINFO:-unknown}\";" \
|
||||
< "${1}"
|
||||
|
|
@ -1900,6 +1900,15 @@
|
|||
}
|
||||
}
|
||||
|
||||
# add (and fix) global scripts scheduler
|
||||
:local OnEvent "/system/script { run global-config; run global-functions; }";
|
||||
:if ([ :len [ /system/scheduler/find where name="global-scripts" ] ] = 0) do={
|
||||
/system/scheduler/add name="global-scripts" start-time=startup;
|
||||
}
|
||||
:if ([ /system/scheduler/get "global-scripts" on-event ] != $OnEvent) do={
|
||||
/system/scheduler/set "global-scripts" on-event=$OnEvent;
|
||||
}
|
||||
|
||||
# Log success
|
||||
:local Resource [ /system/resource/get ];
|
||||
$LogPrintOnce info $ScriptName ("Loaded on " . $Resource->"board-name" . \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue