From 59c5bfcc27e7eb22079754de8a2277a967273168 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Sun, 2 Nov 2025 09:19:16 +0100 Subject: [PATCH 1/3] global-functions: $ScriptInstallUpdate: give hint on ignore Fixes: https://github.com/eworm-de/routeros-scripts/issues/112 --- global-functions.rsc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/global-functions.rsc b/global-functions.rsc index 5ede654..69f7e03 100644 --- a/global-functions.rsc +++ b/global-functions.rsc @@ -1314,6 +1314,11 @@ $LogPrint warning $0 ("Removing dummy. Typo on installation?"); /system/script/remove $Script; } + :if ([ :len ($ScriptInfo->"base-url") ] = 0 && [ :len ($ScriptInfo->"url-suffix") ] = 0 && \ + [ :len $CheckSum ] = 0) do={ + $LogPrintOnce warning $0 \ + ("Added the script manually? Skip updates with 'ignore=true' in comment."); + } :error false; } From 9592a132b7c1cc6f6148c8f7911011a971e9e9e0 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 3 Nov 2025 09:17:25 +0100 Subject: [PATCH 2/3] global-functions: $ScriptInstallUpdate: extra actions on 'not found' only --- global-functions.rsc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/global-functions.rsc b/global-functions.rsc index 69f7e03..28223cc 100644 --- a/global-functions.rsc +++ b/global-functions.rsc @@ -1310,6 +1310,10 @@ } } do={ $LogPrint warning $0 ("Failed fetching script '" . $ScriptVal->"name" . "': " . $Err); + :if ($Err != "Fetch failed with status 404") do={ + :error false; + } + :if ($ScriptVal->"source" = "#!rsc by RouterOS\n") do={ $LogPrint warning $0 ("Removing dummy. Typo on installation?"); /system/script/remove $Script; From 2462ec2f04d0f35b3053bd93419c9bd3f4fdd8ec Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Thu, 6 Nov 2025 17:32:37 +0100 Subject: [PATCH 3/3] Makefile: clean up and add targets --- Makefile | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index bff5458..e376e56 100644 --- a/Makefile +++ b/Makefile @@ -2,14 +2,22 @@ # template scripts -> final scripts # markdown files -> html files -CAPSMAN = $(wildcard *.capsman.rsc) -LOCAL = $(wildcard *.local.rsc) -WIFI = $(wildcard *.wifi.rsc) +ALL_RSC := $(wildcard *.rsc */*.rsc) +GEN_RSC := $(wildcard *.capsman.rsc *.local.rsc *.wifi.rsc) -MARKDOWN = $(wildcard *.md doc/*.md doc/mod/*.md) -HTML = $(MARKDOWN:.md=.html) style.css +MARKDOWN := $(wildcard *.md doc/*.md doc/mod/*.md) +HTML := $(MARKDOWN:.md=.html) style.css -all: $(CAPSMAN) $(LOCAL) $(WIFI) $(HTML) checksums.json +.PHONY: all checksums docs rsc clean + +all: checksums docs rsc + +checksums: checksums.json + +checksums.json: contrib/checksums.sh $(ALL_RSC) + contrib/checksums.sh > $@ + +docs: $(HTML) style.css: contrib/general/style.css cp $< $@ @@ -17,6 +25,8 @@ style.css: contrib/general/style.css %.html: %.md style.css contrib/html.sh contrib/html.sh.d/head.html contrib/html.sh $< > $@ +rsc: $(GEN_RSC) + %.capsman.rsc: %.template.rsc Makefile sed -e '/\/interface\/wifi\//d' -e '/\/interface\/wireless\//d' -e 's|%TEMPL%|.capsman|' \ -e '/^# NOT \/caps-man\/ #$$/,/^# NOT \/caps-man\/ #$$/d' \ @@ -35,8 +45,5 @@ style.css: contrib/general/style.css -e '/^# !!/,/^# !!/c # !! Do not edit this file, it is generated from template!' \ < $< > $@ -checksums.json: contrib/checksums.sh *.rsc */*.rsc - contrib/checksums.sh > $@ - clean: rm -f $(HTML) checksums.json