aboutsummaryrefslogtreecommitdiffstats
path: root/contrib
diff options
context:
space:
mode:
Diffstat (limited to 'contrib')
-rw-r--r--contrib/Makefile17
-rw-r--r--contrib/badges.md6
-rwxr-xr-xcontrib/checksums.sh9
-rwxr-xr-xcontrib/commitinfo.sh6
-rwxr-xr-xcontrib/html.sh23
-rw-r--r--contrib/html.sh.d/foot.html5
-rw-r--r--contrib/html.sh.d/head.html16
-rw-r--r--contrib/logo-color.d/browser-01.avifbin0 -> 42058 bytes
-rw-r--r--contrib/logo-color.d/browser-02.avifbin0 -> 29025 bytes
-rw-r--r--contrib/logo-color.d/browser-03.avifbin0 -> 26034 bytes
-rw-r--r--contrib/logo-color.d/script.js12
-rw-r--r--contrib/logo-color.html62
-rw-r--r--contrib/notification.d/script.js6
-rw-r--r--contrib/notification.html57
-rwxr-xr-xcontrib/static-html.sh10
-rwxr-xr-xcontrib/template-capsman.sh11
-rwxr-xr-xcontrib/template-local.sh11
-rwxr-xr-xcontrib/template-wifi.sh11
18 files changed, 262 insertions, 0 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 @@
+[![GitHub stars](https://img.shields.io/github/stars/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=red)](https://github.com/eworm-de/routeros-scripts/stargazers)
+[![GitHub forks](https://img.shields.io/github/forks/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=green)](https://github.com/eworm-de/routeros-scripts/network)
+[![GitHub watchers](https://img.shields.io/github/watchers/eworm-de/routeros-scripts?logo=GitHub&style=flat&color=blue)](https://github.com/eworm-de/routeros-scripts/watchers)
+[![required RouterOS version](https://img.shields.io/badge/RouterOS-7.15-yellow?style=flat)](https://mikrotik.com/download/changelogs/)
+[![Telegram group @routeros_scripts](https://img.shields.io/badge/Telegram-%40routeros__scripts-%2326A5E4?logo=telegram&style=flat)](https://t.me/routeros_scripts)
+[![donate with PayPal](https://img.shields.io/badge/Like_it%3F-Donate!-orange?logo=githubsponsors&logoColor=orange&style=flat)](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 &copy; 2013-2025 Christian Hesse &lt;mail@eworm.de&gt;</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/browser-01.avif b/contrib/logo-color.d/browser-01.avif
new file mode 100644
index 00000000..3dc0a1f9
--- /dev/null
+++ b/contrib/logo-color.d/browser-01.avif
Binary files differ
diff --git a/contrib/logo-color.d/browser-02.avif b/contrib/logo-color.d/browser-02.avif
new file mode 100644
index 00000000..1867fbe3
--- /dev/null
+++ b/contrib/logo-color.d/browser-02.avif
Binary files differ
diff --git a/contrib/logo-color.d/browser-03.avif b/contrib/logo-color.d/browser-03.avif
new file mode 100644
index 00000000..dc24bbbc
--- /dev/null
+++ b/contrib/logo-color.d/browser-03.avif
Binary files differ
diff --git a/contrib/logo-color.d/script.js b/contrib/logo-color.d/script.js
new file mode 100644
index 00000000..82cc2047
--- /dev/null
+++ b/contrib/logo-color.d/script.js
@@ -0,0 +1,12 @@
+function invertHex(hex) {
+ return (Number("0x1" + hex) ^ 0xffffff).toString(16).substr(1);
+}
+
+function color() {
+ var svg = document.querySelector(".logo").getSVGDocument();
+ svg.getElementById("dark-1").setAttribute("stop-color", document.getElementById("color1").value);
+ svg.getElementById("dark-2").setAttribute("stop-color", document.getElementById("color2").value);
+ var background = document.getElementById("color3").value;
+ svg.getElementById("background").setAttribute("fill", background);
+ svg.getElementById("hexagon").setAttribute("stroke", "#" + invertHex(background.substring(1)));
+}
diff --git a/contrib/logo-color.html b/contrib/logo-color.html
new file mode 100644
index 00000000..e5bfb71e
--- /dev/null
+++ b/contrib/logo-color.html
@@ -0,0 +1,62 @@
+<!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>
+
+<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
+something that differentiates? Color it!</p>
+
+<embed class="logo" src="../logo.svg" width="192" height="192" type="image/svg+xml">
+
+<p>Select the colors here:
+<input id="color1" type="color" value="#222222" onchange="color();">
+<input id="color2" type="color" value="#444444" onchange="color();">
+<input id="color3" type="color" value="#ffffff" onchange="color();"></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" 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="../doc/mod/notification-telegram.md#set-a-profile-photo">Set
+a profile photo</a> for your Telegram bot.</p>
+
+<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 &copy; 2013-2025 Christian Hesse &lt;mail@eworm.de&gt;</p>
+
+</body></html>
diff --git a/contrib/notification.d/script.js b/contrib/notification.d/script.js
new file mode 100644
index 00000000..91741fdd
--- /dev/null
+++ b/contrib/notification.d/script.js
@@ -0,0 +1,6 @@
+function visible(cb, element) {
+ document.getElementById(element).style.display = cb.checked ? "block" : "none";
+}
+function update(cb, element) {
+ document.getElementById(element).innerHTML = cb.value;
+}
diff --git a/contrib/notification.html b/contrib/notification.html
new file mode 100644
index 00000000..baa659c3
--- /dev/null
+++ b/contrib/notification.html
@@ -0,0 +1,57 @@
+<!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>
+
+<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://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://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>
+
+<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 &copy; 2013-2025 Christian Hesse &lt;mail@eworm.de&gt;</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}"