diff options
Diffstat (limited to 'contrib')
| -rw-r--r-- | contrib/Makefile | 17 | ||||
| -rw-r--r-- | contrib/badges.md | 6 | ||||
| -rwxr-xr-x | contrib/checksums.sh | 9 | ||||
| -rwxr-xr-x | contrib/commitinfo.sh | 6 | ||||
| -rwxr-xr-x | contrib/html.sh | 23 | ||||
| -rw-r--r-- | contrib/html.sh.d/foot.html | 5 | ||||
| -rw-r--r-- | contrib/html.sh.d/head.html | 16 | ||||
| -rw-r--r-- | contrib/logo-color.d/style.css | 5 | ||||
| -rw-r--r-- | contrib/logo-color.html | 52 | ||||
| -rw-r--r-- | contrib/notification.d/style.css | 36 | ||||
| -rw-r--r-- | contrib/notification.html | 56 | ||||
| -rwxr-xr-x | contrib/static-html.sh | 10 | ||||
| -rwxr-xr-x | contrib/template-capsman.sh | 11 | ||||
| -rwxr-xr-x | contrib/template-local.sh | 11 | ||||
| -rwxr-xr-x | contrib/template-wifi.sh | 11 |
15 files changed, 201 insertions, 73 deletions
diff --git a/contrib/Makefile b/contrib/Makefile new file mode 100644 index 00000000..e755a1d5 --- /dev/null +++ b/contrib/Makefile @@ -0,0 +1,17 @@ +# Makefile + +HTML := $(shell grep -xl '<!-- static html //-->' *.html) + +.PHONY: all docs clean + +all: docs + +badges.html: badges.md + markdown $< > $@ + +docs: static-html.sh $(HTML) badges.html + ./static-html.sh $(HTML) + +clean: + rm -f badges.html + git checkout HEAD -- $(HTML) diff --git a/contrib/badges.md b/contrib/badges.md new file mode 100644 index 00000000..24bd2055 --- /dev/null +++ b/contrib/badges.md @@ -0,0 +1,6 @@ +[](https://github.com/eworm-de/routeros-scripts/stargazers) +[](https://github.com/eworm-de/routeros-scripts/network) +[](https://github.com/eworm-de/routeros-scripts/watchers) +[](https://mikrotik.com/download/changelogs/) +[](https://t.me/routeros_scripts) +[](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=A4ZXBD6YS2W8J) diff --git a/contrib/checksums.sh b/contrib/checksums.sh new file mode 100755 index 00000000..ab4e9738 --- /dev/null +++ b/contrib/checksums.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +# generate a checksums file as used by $ScriptInstallUpdate + +set -e + +md5sum $(find -name '*.rsc' | sort) | \ + sed -e "s| \./||" -e 's|.rsc$||' | \ + jq --raw-input --null-input '[ inputs | split (" ") | { (.[1]): (.[0]) }] | add' diff --git a/contrib/commitinfo.sh b/contrib/commitinfo.sh new file mode 100755 index 00000000..21faf9fc --- /dev/null +++ b/contrib/commitinfo.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +sed \ + -e "/^:global CommitId/c :global CommitId \"${COMMITID:-unknown}\";" \ + -e "/^:global CommitInfo/c :global CommitInfo \"${COMMITINFO:-unknown}\";" \ + < "${1}" diff --git a/contrib/html.sh b/contrib/html.sh new file mode 100755 index 00000000..03eba23d --- /dev/null +++ b/contrib/html.sh @@ -0,0 +1,23 @@ +#!/bin/sh + +set -e + +RELTO="$(dirname "${1}")" + +sed \ + -e "s|__TITLE__|$(head -n1 "${1}")|" \ + -e "s|__GENERAL__|$(realpath --relative-to="${RELTO}" general/)|" \ + -e "s|__ROOT__|$(realpath --relative-to="${RELTO}" ./)|" \ + < "${0}.d/head.html" + +markdown -f toc,idanchor "${1}" | sed \ + -e 's/href="\([-_\./[:alnum:]]*\)\.md\(#[-[:alnum:]]*\)\?"/href="\1.html\2"/g' \ + -e '/<h[1234] /s| id="\(.*\)">| id="\L\1">|' \ + -e '/<h[1234] /s|-2[1789cd]-||g' -e '/<h[1234] /s|--26-amp-3b-||g' \ + -e '/^<pre>/s|pre|pre class="code" onclick="CopyToClipboard(this)"|g' \ + -e '/The above link may be broken on code hosting sites/s|blockquote|blockquote style="display: none;"|' + +sed \ + -e "s|__DATE__|${DATE:-$(date --rfc-email)}|" \ + -e "s|__VERSION__|${VERSION:-unknown}|" \ + < "${0}.d/foot.html" diff --git a/contrib/html.sh.d/foot.html b/contrib/html.sh.d/foot.html new file mode 100644 index 00000000..d3041520 --- /dev/null +++ b/contrib/html.sh.d/foot.html @@ -0,0 +1,5 @@ + +<p class="foot">RouterOS Scripts documentation generated on <i>__DATE__</i> for <i>__VERSION__</i><br /> +Copyright © 2013-2025 Christian Hesse <mail@eworm.de></p> + +</body></html> diff --git a/contrib/html.sh.d/head.html b/contrib/html.sh.d/head.html new file mode 100644 index 00000000..656a63c0 --- /dev/null +++ b/contrib/html.sh.d/head.html @@ -0,0 +1,16 @@ +<!DOCTYPE html><html lang="en"> +<head><meta http-equiv="content-type" content="text/html; charset=UTF-8"> +<title>RouterOS Scripts :: __TITLE__</title> +<link rel="stylesheet" type="text/css" href="__GENERAL__/style.css"> +<link rel="icon" type="image/png" href="__ROOT__/logo.png"> +<script type="text/javascript" src="__GENERAL__/clipboard.js"></script> +</head><body> + +<table><tr> + <td><img src="__GENERAL__/eworm-meadow.avif" alt="eworm on meadow" /></td> + <td><img src="__GENERAL__/qr-code.png" alt="QR code: rsc.eworm.de" /></td> + <td class="head"><span class="top">RouterOS Scripts</span><br /> + <span class="bottom">a collection of scripts for MikroTik RouterOS</span></td> +</tr></table> +<hr /> + diff --git a/contrib/logo-color.d/style.css b/contrib/logo-color.d/style.css deleted file mode 100644 index eb2ec6a1..00000000 --- a/contrib/logo-color.d/style.css +++ /dev/null @@ -1,5 +0,0 @@ -body { - font-family: fira-sans, sans-serif; - font-size: 10pt; - background-color: transparent; -} diff --git a/contrib/logo-color.html b/contrib/logo-color.html index 17942cea..e5bfb71e 100644 --- a/contrib/logo-color.html +++ b/contrib/logo-color.html @@ -1,14 +1,30 @@ -<!DOCTYPE html> -<html lang="en"> -<head> -<meta charset="UTF-8"> -<title>RouterOS-Scripts Logo Color Changer</title> -<link rel="stylesheet" type="text/css" href="logo-color.d/style.css"> +<!DOCTYPE html><html lang="en"> +<!-- static html //--> +<head><meta http-equiv="content-type" content="text/html; charset=UTF-8"> +<title>RouterOS Scripts :: Logo Color Changer</title> +<link rel="stylesheet" type="text/css" href="../general/style.css"> +<link rel="icon" type="image/png" href="../logo.png"> <script src="logo-color.d/script.js"></script> -</head> -<body> +</head><body> -<h1>RouterOS-Scripts Logo Color Changer</h1> +<table><tr> + <td><img src="../general/eworm-meadow.avif" alt="eworm on meadow" /></td> + <td><img src="../general/qr-code.png" alt="QR code: rsc.eworm.de" /></td> + <td class="head"><span class="top">RouterOS Scripts</span><br /> + <span class="bottom">a collection of scripts for MikroTik RouterOS</span></td> +</tr></table> +<hr /> + +<h1>Logo Color Changer</h1> + +<!-- badges here //--> + +<p><a href="../README.md">⬅️ Go back to main README</a></p> + +<blockquote style="/* display */"><p>💡️ <strong>Hint</strong>: This site or links +on it may be broken on code hosting sites. Use +<a href="https://rsc.eworm.de/main/contrib/logo-color.html">Logo Color Changer</a> +instead.</p></blockquote> <p>You want the logo for your own notifications? But you joined the <a href="https://t.me/routeros_scripts">Telegram Group</a> and want @@ -24,17 +40,23 @@ something that differentiates? Color it!</p> <p>Then right-click, click "<i>Take Screenshot</i>" and finally select the logo and download it.</p> -<p><img src="logo-color.d/browser-01.avif" width=533 height=482 alt="Screenshot Browser 01"> -<img src="logo-color.d/browser-02.avif" width=533 height=482 alt="Screenshot Browser 02"> -<img src="logo-color.d/browser-03.avif" width=533 height=482 alt="Screenshot Browser 03"></p> +<p><img src="logo-color.d/browser-01.avif" alt="Screenshot Browser 01"></p> +<p><img src="logo-color.d/browser-02.avif" alt="Screenshot Browser 02"></p> +<p><img src="logo-color.d/browser-03.avif" alt="Screenshot Browser 03"></p> <p>(This example is with <a href="https://www.mozilla.org/de/firefox/new/">Firefox</a>. The workflow for other browsers may differ.)</p> <p>See how to -<a href="../../about/doc/mod/notification-telegram.md#set-a-profile-photo">Set +<a href="../doc/mod/notification-telegram.md#set-a-profile-photo">Set a profile photo</a> for your Telegram bot.</p> -</body> -</html> +<hr /> + +<p><a href="../README.md">⬅️ Go back to main README</a><br/> +<a href="#top">⬆️ Go back to top</a></p> + +<p class="foot">Copyright © 2013-2025 Christian Hesse <mail@eworm.de></p> + +</body></html> diff --git a/contrib/notification.d/style.css b/contrib/notification.d/style.css deleted file mode 100644 index 648ea23c..00000000 --- a/contrib/notification.d/style.css +++ /dev/null @@ -1,36 +0,0 @@ -body { - font-family: fira-sans, sans-serif; - font-size: 10pt; - background-color: transparent; -} -div.notification { - position: relative; - float: right; - width: 600px; - border: 3px outset #6c5d53; - /* border-radius: 5px; */ - padding: 10px; - background-color: #e6e6e6; -} -div.content { - padding-left: 60px; -} -img.logo { - float: left; - border-radius: 50%; -} -p.heading { - margin: 0px; - font-weight: bold; - text-decoration: underline; -} -p.hint { - display: none; -} -pre { - font-family: fira-mono, monospace; - white-space: pre-wrap; -} -span.link { - color: #863600; -} diff --git a/contrib/notification.html b/contrib/notification.html index 78750362..baa659c3 100644 --- a/contrib/notification.html +++ b/contrib/notification.html @@ -1,35 +1,57 @@ -<!DOCTYPE html> -<html lang="en"> -<head> -<meta charset="UTF-8"> -<title>RouterOS-Scripts Notification Generator</title> -<link rel="stylesheet" type="text/css" href="notification.d/style.css"> -<script src="notification.d/script.js"></script> -</head> -<body> +<!DOCTYPE html><html lang="en"> +<!-- static html //--> +<head><meta http-equiv="content-type" content="text/html; charset=UTF-8"> +<title>RouterOS Scripts :: Notification Generator</title> +<link rel="stylesheet" type="text/css" href="../general/style.css"> +<link rel="icon" type="image/png" href="../logo.png"> +<script src="notification.d/script.js"></script> +</head><body> -<h1>RouterOS-Scripts Notification Generator</h1> +<table><tr> + <td><img src="../general/eworm-meadow.avif" alt="eworm on meadow" /></td> + <td><img src="../general/qr-code.png" alt="QR code: rsc.eworm.de" /></td> + <td class="head"><span class="top">RouterOS Scripts</span><br /> + <span class="bottom">a collection of scripts for MikroTik RouterOS</span></td> +</tr></table> +<hr /> + +<h1>Notification Generator</h1> + +<!-- badges here //--> + +<p><a href="../README.md">⬅️ Go back to main README</a></p> + +<blockquote style="/* display */"><p>💡️ <strong>Hint</strong>: This site or links +on it may be broken on code hosting sites. Use +<a href="https://rsc.eworm.de/main/contrib/notification.html">Notification Generator</a> +instead.</p></blockquote> <div class="notification"> <img src="../logo.svg" alt="logo" class="logo" width=48 height=48> <div class="content"> <p id="heading" class="heading">[<span id="hostname">MikroTik</span>] <span id="subject">ℹ️ Subject</span></p> <pre id="message">Message</pre> - <p id="link" class="hint">🔗 <span id="link-text" class="link">https://eworm.de/</span></p> - <p id="queued" class="hint">⏰ This message was queued since <span id="queued-since">oct/18/2022 18:30:48</span> and may be obsolete.</p> - <p id="cut" class="hint">✂️ The message was too long and has been truncated, cut off <span id="cut-percent">13</span>%!</p> + <p id="link" class="hint">🔗 <span id="link-text" class="link">https://rsc.eworm.de/</span></p> + <p id="queued" class="hint">⏰ This message was queued since <i><span id="queued-since">2025-10-29 16:06:18</span></i> and may be obsolete.</p> + <p id="cut" class="hint">✂️ The message was too long and has been truncated, cut off <i><span id="cut-percent">13</span>%</i>!</p> </div> </div> <p>Hostname: <input type="text" value="MikroTik" onchange="update(this, 'hostname')"></p> <p>Subject: <input type="text" size=50 value="ℹ️ Subject" onchange="update(this, 'subject')"></p> <p>Message: <textarea id="w3review" name="w3review" rows="4" cols="50" onchange="update(this, 'message')">Message</textarea></p> -<p><input type="checkbox" onclick="visible(this, 'link')"> Show link: <input type="text" value="https://eworm.de/" onchange="update(this, 'link-text')"></p> -<p><input type="checkbox" onclick="visible(this, 'queued')"> Queued since <input type="text" value="oct/18/2022 18:30:48" onchange="update(this, 'queued-since')"></p> +<p><input type="checkbox" onclick="visible(this, 'link')"> Show link: <input type="text" value="https://rsc.eworm.de/" onchange="update(this, 'link-text')"></p> +<p><input type="checkbox" onclick="visible(this, 'queued')"> Queued since <input type="text" value="2025-10-29 16:06:18" onchange="update(this, 'queued-since')"></p> <p><input type="checkbox" onclick="visible(this, 'cut')"> Cut-off with <input type="number" min=1 max=99 value=13 onchange="update(this, 'cut-percent')"> percent</p> <p>Then right-click, click "<i>Take Screenshot</i>" and finally select the notification and download it.</p> -</body> -</html> +<hr /> + +<p><a href="../README.md">⬅️ Go back to main README</a><br/> +<a href="#top">⬆️ Go back to top</a></p> + +<p class="foot">Copyright © 2013-2025 Christian Hesse <mail@eworm.de></p> + +</body></html> diff --git a/contrib/static-html.sh b/contrib/static-html.sh new file mode 100755 index 00000000..7acf1041 --- /dev/null +++ b/contrib/static-html.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +set -e + +sed -i \ + -e '/href=/s|\.md|\.html|' \ + -e '/blockquote/s|/\* display \*/|display: none;|' \ + -e '/<!-- badges here \/\/-->/r badges.html' \ + -e '/<!-- badges here \/\/-->/d' \ + "${@}" diff --git a/contrib/template-capsman.sh b/contrib/template-capsman.sh new file mode 100755 index 00000000..5771b53c --- /dev/null +++ b/contrib/template-capsman.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +set -e + +sed \ + -e '/\/interface\/wifi\//d' \ + -e '/\/interface\/wireless\//d' \ + -e 's|%TEMPL%|.capsman|' \ + -e '/^# NOT \/caps-man\/ #$/,/^# NOT \/caps-man\/ #$/d' \ + -e '/^# !!/,/^# !!/c # !! Do not edit this file, it is generated from template!' \ + < "${1}" diff --git a/contrib/template-local.sh b/contrib/template-local.sh new file mode 100755 index 00000000..bc5b3272 --- /dev/null +++ b/contrib/template-local.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +set -e + +sed \ + -e '/\/caps-man\//d' \ + -e '/\/interface\/wifi\//d' \ + -e 's|%TEMPL%|.local|' \ + -e '/^# NOT \/interface\/wireless\/ #$/,/^# NOT \/interface\/wireless\/ #$/d' \ + -e '/^# !!/,/^# !!/c # !! Do not edit this file, it is generated from template!' \ + < "${1}" diff --git a/contrib/template-wifi.sh b/contrib/template-wifi.sh new file mode 100755 index 00000000..5e297d9e --- /dev/null +++ b/contrib/template-wifi.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +set -e + +sed \ + -e '/\/caps-man\//d' \ + -e '/\/interface\/wireless\//d' \ + -e 's|%TEMPL%|.wifi|' \ + -e '/^# NOT \/interface\/wifi\/ #$/,/^# NOT \/interface\/wifi\/ #$/d' \ + -e '/^# !!/,/^# !!/c # !! Do not edit this file, it is generated from template!' \ + < "${1}" |