script-updates: add support for url suffix

This allows to fetch from different branch...
This commit is contained in:
Christian Hesse 2018-08-27 11:15:03 +02:00
parent 529acebc7b
commit 21f2b04f9a
2 changed files with 3 additions and 1 deletions

View file

@ -46,6 +46,7 @@
:global "script-updates-baseurl" "https://git.eworm.de/cgit.cgi/routeros-scripts/plain/"; :global "script-updates-baseurl" "https://git.eworm.de/cgit.cgi/routeros-scripts/plain/";
#:global "script-updates-baseurl" "https://raw.githubusercontent.com/eworm-de/routeros-scripts/master/"; #:global "script-updates-baseurl" "https://raw.githubusercontent.com/eworm-de/routeros-scripts/master/";
#:global "script-updates-baseurl" "https://gitlab.com/eworm-de/routeros-scripts/raw/master/"; #:global "script-updates-baseurl" "https://gitlab.com/eworm-de/routeros-scripts/raw/master/";
:global "script-updates-urlsuffix" "";
:global "script-updates-ignore" { "global-config"; "GeneratePSK" }; :global "script-updates-ignore" { "global-config"; "GeneratePSK" };
# Do *NOT* change these! # Do *NOT* change these!

View file

@ -6,6 +6,7 @@
:global "script-updates-fetch"; :global "script-updates-fetch";
:global "script-updates-baseurl"; :global "script-updates-baseurl";
:global "script-updates-urlsuffix";
:global "script-updates-ignore"; :global "script-updates-ignore";
:foreach script in=[ / system script find ] do={ :foreach script in=[ / system script find ] do={
@ -23,7 +24,7 @@
:do { :do {
/ tool fetch check-certificate=yes-without-crl \ / tool fetch check-certificate=yes-without-crl \
dst-path=("script-updates/" . $scriptname) \ dst-path=("script-updates/" . $scriptname) \
($"script-updates-baseurl" . $scriptname); ($"script-updates-baseurl" . $scriptname . $"script-updates-urlsuffix");
:set scriptfile [ / file find where name=("script-updates/" . $scriptname) ]; :set scriptfile [ / file find where name=("script-updates/" . $scriptname) ];
} on-error={ } on-error={
:log debug ("Failed fetching " . $scriptname); :log debug ("Failed fetching " . $scriptname);