diff --git a/Makefile b/Makefile index 0265a51a..89517410 100644 --- a/Makefile +++ b/Makefile @@ -11,8 +11,8 @@ HTML = $(MARKDOWN:.md=.html) all: $(CAPSMAN) $(LOCAL) $(WIFI) $(HTML) checksums.json -%.html: %.md contrib/html.sh contrib/html.sh.d/head.html - contrib/html.sh $< > $@ +%.html: %.md Makefile + markdown $< | sed 's/href="\([-_\./[:alnum:]]*\)\.md"/href="\1.html"/g' > $@ %.capsman.rsc: %.template.rsc Makefile sed -e '/\/interface\/wifi\//d' -e '/\/interface\/wireless\//d' -e 's|%TEMPL%|.capsman|' \ diff --git a/contrib/html.sh b/contrib/html.sh deleted file mode 100755 index bbd8ba86..00000000 --- a/contrib/html.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh - -set -e - -sed "s|__TITLE__|$(head -n1 "${1}")|" < "${0}.d/head.html" -markdown -f toc,idanchor "${1}" | sed \ - -e 's/href="\([-_\./[:alnum:]]*\)\.md"/href="\1.html"/g' \ - -e '/| id="\L\1">|' -printf '' diff --git a/contrib/html.sh.d/head.html b/contrib/html.sh.d/head.html deleted file mode 100644 index 1b1dd03a..00000000 --- a/contrib/html.sh.d/head.html +++ /dev/null @@ -1,15 +0,0 @@ - -RouterOS Scripts :: __TITLE__ - - - - diff --git a/global-functions.rsc b/global-functions.rsc index 98bc306c..10d1b412 100644 --- a/global-functions.rsc +++ b/global-functions.rsc @@ -1787,11 +1787,14 @@ :local Delay ([ $MAX [ $EitherOr $WaitTime 2s ] 100ms ] / 9); :do { - :retry { - /file/get $FileName; - :return true; + :retry { + :if ([ :len [ /file/find where name=$FileName ] ] = 0) do={ + :error false; + } } delay=$Delay max=10; - } on-error={ } + } on-error={ + :return false; + } :while ([ :len [ /file/find where name=$FileName ] ] > 0) do={ :do { diff --git a/mod/ssh-keys-import.rsc b/mod/ssh-keys-import.rsc index dd32fd6b..7bdc95da 100644 --- a/mod/ssh-keys-import.rsc +++ b/mod/ssh-keys-import.rsc @@ -85,7 +85,7 @@ :return false; } - :if ([ $FileExists $FileName ] = false) do={ + :if ([ $FileExists $FileName ] = true) do={ $LogPrint warning $0 ("File '" . $FileName . "' does not exist."); :return false; } diff --git a/packages-update.rsc b/packages-update.rsc index cfe5222e..d3140f29 100644 --- a/packages-update.rsc +++ b/packages-update.rsc @@ -41,11 +41,6 @@ /system/reboot; } - :if ([ /system/scheduler/find where name="_RebootForUpdate" ] > 0) do={ - $LogPrint warning $ScriptName ("Scheduler for reboot already exists."); - :return false; - } - :local Interval [ $IfThenElse ([ :totime $PackagesUpdateDeferReboot ] >= 1d) \ $PackagesUpdateDeferReboot 1d ]; :local StartTime [ :tostr [ :totime (10800 + [ $GetRandomNumber 7200 ]) ] ];