diff --git a/INITIAL-COMMANDS.md b/INITIAL-COMMANDS.md index 374f7165..787c11e6 100644 --- a/INITIAL-COMMANDS.md +++ b/INITIAL-COMMANDS.md @@ -45,6 +45,9 @@ 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; diff --git a/Makefile b/Makefile index 83c38ccf..3d428ba3 100644 --- a/Makefile +++ b/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 commitinfo docs rsc clean +.PHONY: all checksums docs rsc clean all: checksums docs rsc @@ -21,9 +21,6 @@ checksums: checksums.json checksums.json: contrib/checksums.sh $(ALL_RSC) contrib/checksums.sh > $@ -commitinfo: - contrib/commitinfo.sh - docs: $(HTML) %.html: %.md general/style.css contrib/html.sh contrib/html.sh.d/head.html diff --git a/README.d/05-run-and-schedule-scripts.avif b/README.d/05-run-and-schedule-scripts.avif new file mode 100644 index 00000000..37e1173f Binary files /dev/null and b/README.d/05-run-and-schedule-scripts.avif differ diff --git a/README.d/05-run-scripts.avif b/README.d/05-run-scripts.avif deleted file mode 100644 index e3b8b8b4..00000000 Binary files a/README.d/05-run-scripts.avif and /dev/null differ diff --git a/README.md b/README.md index 6c4e94ed..af9ef658 100644 --- a/README.md +++ b/README.md @@ -129,12 +129,12 @@ Now let's download the main scripts and add them in configuration on the fly. ![screenshot: import scripts](README.d/04-import-scripts.avif) -And finally run configuration and functions. This will also add the -scheduler for loading at system startup automatically. +And finally load configuration and functions and add the scheduler. /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; }"; -![screenshot: run and schedule scripts](README.d/05-run-scripts.avif) +![screenshot: run and schedule scripts](README.d/05-run-and-schedule-scripts.avif) > 💡️ **Hint**: You see complaints regarding syntax errors? Most likely the > RouterOS on your device is too old. Check for updates! diff --git a/contrib/Makefile b/contrib/Makefile index cdb9f4cd..56b87074 100644 --- a/contrib/Makefile +++ b/contrib/Makefile @@ -7,7 +7,6 @@ HTML := $(wildcard *.html) all: docs docs: $(HTML) - sed -i \ - -e '/href=/s|\.md|\.html|' \ + sed -i -e '/href=/s|\.md|\.html|' \ -e '/blockquote/s|/\*! display \*/|display: none;|' \ $(HTML) diff --git a/contrib/commitinfo.sh b/contrib/commitinfo.sh deleted file mode 100755 index 6c82465b..00000000 --- a/contrib/commitinfo.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -sed -i \ - -e "/^:global CommitId/c :global CommitId \"${COMMITID:-unknown}\";" \ - -e "/^:global CommitInfo/c :global CommitInfo \"${COMMITINFO:-unknown}\";" \ - global-functions.rsc diff --git a/global-functions.rsc b/global-functions.rsc index 91e8d62c..dccb8b6e 100644 --- a/global-functions.rsc +++ b/global-functions.rsc @@ -1900,14 +1900,6 @@ } } -:if ([ :len [ /system/scheduler/find where name="global-scripts" ] ] = 0) do={ - /system/scheduler/add name="global-scripts" start-time=startup; -} -:local OnEvent "/system/script { run global-config; run global-functions; }"; -: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" . \