mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2026-03-04 13:09:37 +00:00
Compare commits
7 commits
5535747962
...
7f3cfc46c1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7f3cfc46c1 | ||
|
|
6633b865f6 | ||
|
|
fe080c0d3d | ||
|
|
a856d309df | ||
|
|
721e786f68 | ||
|
|
4c2c7e817a | ||
|
|
89175e511f |
8 changed files with 25 additions and 18 deletions
|
|
@ -4,7 +4,7 @@ Initial commands
|
|||
[](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://mikrotik.com/download/changelogs/)
|
||||
[](https://t.me/routeros_scripts)
|
||||
[](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=A4ZXBD6YS2W8J)
|
||||
|
||||
|
|
@ -22,8 +22,8 @@ Run the complete base installation:
|
|||
:local CertFileName "ISRG-Root-X2.pem";
|
||||
:local CertFingerprint "69729b8e15a86efc177a57afb7171dfc64add28c2fca8cf1507e34453ccb1470";
|
||||
|
||||
:if (!(([ /certificate/settings/get ]->"builtin-trust-anchors") = "trusted" && \
|
||||
[[ :parse (":return [ :len [ /certificate/builtin/find where common-name=\"" . $CertCommonName . "\" ] ]") ]] > 0)) do={
|
||||
:if (!([ /certificate/settings/get builtin-trust-anchors ] = "trusted" && \
|
||||
[ :len [ /certificate/builtin/find where common-name=$CertCommonName ] ] > 0)) do={
|
||||
:put "Importing certificate...";
|
||||
/tool/fetch ($BaseUrl . "certs/" . $CertFileName) dst-path=$CertFileName as-value;
|
||||
:delay 1s;
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ RouterOS Scripts
|
|||
[](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://mikrotik.com/download/changelogs/)
|
||||
[](https://t.me/routeros_scripts)
|
||||
[](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=A4ZXBD6YS2W8J)
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@
|
|||
:foreach AccList in=[ /caps-man/access-list/find where mac-address!="00:00:00:00:00:00" ] do={
|
||||
:local Mac [ /caps-man/access-list/get $AccList mac-address ];
|
||||
:if ($Seen->$Mac = 1) do={
|
||||
/caps-man/access-list/print where mac-address=$Mac;
|
||||
/caps-man/access-list/print without-paging where mac-address=$Mac;
|
||||
:local Remove [ :tonum [ /terminal/ask prompt="\nNumeric id to remove, any key to skip!" ] ];
|
||||
|
||||
:if ([ :typeof $Remove ] = "num") do={
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@
|
|||
:foreach AccList in=[ /interface/wireless/access-list/find where mac-address!="00:00:00:00:00:00" ] do={
|
||||
:local Mac [ /interface/wireless/access-list/get $AccList mac-address ];
|
||||
:if ($Seen->$Mac = 1) do={
|
||||
/interface/wireless/access-list/print where mac-address=$Mac;
|
||||
/interface/wireless/access-list/print without-paging where mac-address=$Mac;
|
||||
:local Remove [ :tonum [ /terminal/ask prompt="\nNumeric id to remove, any key to skip!" ] ];
|
||||
|
||||
:if ([ :typeof $Remove ] = "num") do={
|
||||
|
|
|
|||
|
|
@ -27,9 +27,9 @@
|
|||
:local Mac [ /interface/wifi/access-list/get $AccList mac-address ];
|
||||
:local Mac [ /interface/wireless/access-list/get $AccList mac-address ];
|
||||
:if ($Seen->$Mac = 1) do={
|
||||
/caps-man/access-list/print where mac-address=$Mac;
|
||||
/interface/wifi/access-list/print where mac-address=$Mac;
|
||||
/interface/wireless/access-list/print where mac-address=$Mac;
|
||||
/caps-man/access-list/print without-paging where mac-address=$Mac;
|
||||
/interface/wifi/access-list/print without-paging where mac-address=$Mac;
|
||||
/interface/wireless/access-list/print without-paging where mac-address=$Mac;
|
||||
:local Remove [ :tonum [ /terminal/ask prompt="\nNumeric id to remove, any key to skip!" ] ];
|
||||
|
||||
:if ([ :typeof $Remove ] = "num") do={
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@
|
|||
:foreach AccList in=[ /interface/wifi/access-list/find where mac-address!="00:00:00:00:00:00" ] do={
|
||||
:local Mac [ /interface/wifi/access-list/get $AccList mac-address ];
|
||||
:if ($Seen->$Mac = 1) do={
|
||||
/interface/wifi/access-list/print where mac-address=$Mac;
|
||||
/interface/wifi/access-list/print without-paging where mac-address=$Mac;
|
||||
:local Remove [ :tonum [ /terminal/ask prompt="\nNumeric id to remove, any key to skip!" ] ];
|
||||
|
||||
:if ([ :typeof $Remove ] = "num") do={
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
# Michael Gisbers <michael@gisbers.de>
|
||||
# https://rsc.eworm.de/COPYING.md
|
||||
#
|
||||
# requires RouterOS, version=7.15
|
||||
# requires RouterOS, version=7.19
|
||||
# requires device-mode, fetch, scheduler
|
||||
#
|
||||
# global functions
|
||||
|
|
@ -121,8 +121,8 @@
|
|||
:return false;
|
||||
}
|
||||
|
||||
:if (([ /certificate/settings/get ]->"builtin-trust-anchors") = "trusted" && \
|
||||
[[ :parse (":return [ :len [ /certificate/builtin/find where common-name=\"" . $CommonName . "\" ] ]") ]] > 0) do={
|
||||
:if ([ /certificate/settings/get builtin-trust-anchors ] = "trusted" && \
|
||||
[ :len [ /certificate/builtin/find where common-name=$CommonName ] ] > 0) do={
|
||||
:return true;
|
||||
}
|
||||
|
||||
|
|
@ -133,6 +133,11 @@
|
|||
}
|
||||
}
|
||||
|
||||
:if ([ :len [ /certificate/find where common-name=$CommonName ] ] > 1) do={
|
||||
$LogPrint info $0 ("There are " . $CertCount . " Certificates with CommonName '" . $CommonName . "'. Should be ok.");
|
||||
:return true;
|
||||
}
|
||||
|
||||
:local CertVal [ /certificate/get [ find where common-name=$CommonName ] ];
|
||||
:while (($CertVal->"akid") != "" && ($CertVal->"akid") != ($CertVal->"skid")) do={
|
||||
:if ([ :len [ /certificate/find where skid=($CertVal->"akid") ] ] = 0) do={
|
||||
|
|
@ -1608,7 +1613,9 @@
|
|||
|
||||
:global LogPrintOnce;
|
||||
|
||||
:local Symbols {
|
||||
:global SymbolsExtra;
|
||||
|
||||
:local Symbols ({
|
||||
"abacus"="\F0\9F\A7\AE";
|
||||
"alarm-clock"="\E2\8F\B0";
|
||||
"arrow-down"="\E2\AC\87";
|
||||
|
|
@ -1643,7 +1650,7 @@
|
|||
"star"="\E2\AD\90";
|
||||
"warning-sign"="\E2\9A\A0";
|
||||
"white-heavy-check-mark"="\E2\9C\85"
|
||||
}
|
||||
}, $SymbolsExtra);
|
||||
|
||||
:if ([ :len ($Symbols->$Name) ] = 0) do={
|
||||
$LogPrintOnce warning $0 ("No symbol available for name '" . $Name . "'!");
|
||||
|
|
|
|||
|
|
@ -62,14 +62,14 @@
|
|||
|
||||
:local FwAddrList ($ScriptName . "-" . [ $GetRandom20CharAlNum ]);
|
||||
:if ([ :typeof [ :toip $Expected ] ] = "ip") do={
|
||||
/ip/firewall/address-list/add address=$Name list=$FwAddrList dynamic=yes timeout=10s;
|
||||
/ip/firewall/address-list/add address=$Name list=$FwAddrList dynamic=yes timeout=30s;
|
||||
:delay 20ms;
|
||||
:if ([ :len [ /ip/firewall/address-list/find where list=$FwAddrList address=$Expected ] ] > 0) do={
|
||||
:return true;
|
||||
}
|
||||
}
|
||||
:if ([ :typeof [ :toip6 $Expected ] ] = "ip6") do={
|
||||
/ipv6/firewall/address-list/add address=$Name list=$FwAddrList dynamic=yes timeout=10s;
|
||||
/ipv6/firewall/address-list/add address=$Name list=$FwAddrList dynamic=yes timeout=30s;
|
||||
:delay 20ms;
|
||||
:if ([ :len [ /ipv6/firewall/address-list/find where list=$FwAddrList address=$Expected ] ] > 0) do={
|
||||
:return true;
|
||||
|
|
@ -127,7 +127,7 @@
|
|||
$LogPrint [ $IfThenElse ($HostInfo->"no-resolve-fail" != true) warning debug ] \
|
||||
$ScriptName ("Resolving name '" . $HostInfo->"resolve" . [ $IfThenElse \
|
||||
($HostInfo->"resolve" != $HostInfo->"name") ("' for " . $Type . " '" . \
|
||||
$HostInfo->"name") "" ] . "' failed: " . $Err);
|
||||
$HostInfo->"name") "" ] . "' failed third time: " . $Err);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue