Compare commits

..

No commits in common. "14b51d96b0b9fd80e0364407f377c26e8e0222ec" and "59dc7e6d0c1ced35151b35c085f4a915f6333526" have entirely different histories.

6 changed files with 10 additions and 36 deletions

View file

@ -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|' \

View file

@ -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 '/<h[1234] /s| id="\(.*\)">| id="\L\1">|'
printf '</body></html>'

View file

@ -1,15 +0,0 @@
<!DOCTYPE html><html lang="en">
<head><title>RouterOS Scripts :: __TITLE__</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<style>
body { font-family: sans-serif; }
h2 { border-bottom: 1px solid #ccc; color: #000; }
a { text-decoration: none; }
a:hover { text-decoration: underline; }
blockquote { border-left: 4px solid #ccc; padding: 0 10px; color: #777; }
code { margin: 0 2px; padding: 2px 5px; border: 1px solid #ccc; background-color: #f8f8f8; border-radius: 3px; }
pre { background-color: #f8f8f8; border: 1px solid #ccc; overflow: auto; padding: 6px 10px; border-radius: 3px; }
pre code { margin: 0; padding: 0; border: 0; }
</style>
<link rel="icon" href="/logo.png" type="image/png">
</head><body>

View file

@ -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 {

View file

@ -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;
}

View file

@ -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 ]) ] ];