Commit graph

215 commits

Author SHA1 Message Date
Christian Hesse
df7cb1b88b check-certificates: shorten key for detailed infos 2019-01-09 17:38:55 +01:00
Christian Hesse
e51daf2761 check-certificates: show issuer CN only 2019-01-09 17:34:08 +01:00
Christian Hesse
57d93aa701 email-backup: be more verbose about attached files and secret key 2019-01-09 15:06:01 +01:00
Christian Hesse
fe34a80a3d check-certificates: include the issuer in notifications 2019-01-09 14:33:09 +01:00
Christian Hesse
1b9a277b47 check-certificates: update CommonName after renewal 2019-01-09 14:29:15 +01:00
Christian Hesse
40931f4f28 super-mario-theme: simplify array access 2019-01-09 12:54:59 +01:00
Christian Hesse
bd92237003 daily-psk: simplify algorithm 2019-01-09 12:52:30 +01:00
Christian Hesse
1ee2491e66 check-certificates: use time functionality
No need to calculate that...
2019-01-09 11:43:30 +01:00
Christian Hesse
5539233417 check-certificates: send notification on renewal 2019-01-09 10:38:41 +01:00
Christian Hesse
6b6c3d5119 check-certificates: drop extra warning
A sent notification implies that renewal failed.
2019-01-09 10:31:54 +01:00
Christian Hesse
0abb9a1848 ppp-on-up: just release ipv6 lease
This should get a new lease immediately.
2019-01-04 20:32:14 +01:00
Christian Hesse
63406dafbe ppp-on-up: run scripts if available 2019-01-04 20:29:42 +01:00
Christian Hesse
1cd7679a07 update-tunnelbroker: get tunnelbroker config from interface comment 2019-01-04 20:20:20 +01:00
Christian Hesse
698bed2bbc email-backup: print to update from cloud 2019-01-04 14:14:37 +01:00
Christian Hesse
c3f27bf776 ppp-on-up: fix variable handling
The variable $interface is not a name but a reference... Basically
this worked only because of the oddity - the filter did not work
and *all* dhcp-clients were disabled and enabled.
2019-01-04 13:02:34 +01:00
Christian Hesse
870f00bb36 global: variable names are CamelCase
___  _         ___     __
           / _ )(_)__ _   / _/__ _/ /_
          / _  / / _ `/  / _/ _ `/ __/
         /____/_/\_, /  /_/ \_,_/\__/
 _       __     /___/       _             __
| |     / /___ __________  (_)___  ____ _/ /
| | /| / / __ `/ ___/ __ \/ / __ \/ __ `/ /
| |/ |/ / /_/ / /  / / / / / / / / /_/ /_/
|__/|__/\__,_/_/  /_/ /_/_/_/ /_/\__, (_)
                                /____/

RouterOS has some odd behavior when it comes to variable names. Let's
have a look at the interfaces:

[admin@MikroTik] > / interface print where name=en1
Flags: D - dynamic, X - disabled, R - running, S - slave
 #     NAME                                TYPE       ACTUAL-MTU L2MTU
 0  RS en1                                 ether            1500  1598

That looks ok. Now we use a script:

{ :local interface "en1";
  / interface print where name=$interface; }

And the result...

[admin@MikroTik] > { :local interface "en1";
{...   / interface print where name=$interface; }
Flags: D - dynamic, X - disabled, R - running, S - slave
 #     NAME                                TYPE       ACTUAL-MTU L2MTU
 0  RS en1                                 ether            1500  1598

... still looks ok.
We make a little modification to the script:

{ :local name "en1";
  / interface print where name=$name; }

And the result:

[admin@MikroTik] > { :local name "en1";
{...   / interface print where name=$name; }
Flags: D - dynamic, X - disabled, R - running, S - slave
 #     NAME                                TYPE       ACTUAL-MTU L2MTU
 0  RS en1                                 ether            1500  1598
 1   S en2                                 ether            1500  1598
 2   S en3                                 ether            1500  1598
 3   S en4                                 ether            1500  1598
 4   S en5                                 ether            1500  1598
 5  R  br-local                            bridge           1500  1598

Ups! The filter has no effect!
That happens whenever the variable name ($name) matches the property
name (name=).

And another modification:

{ :local type "en1";
  / interface print where name=$type; }

And the result:

[admin@MikroTik] > { :local type "en1";
{...   / interface print where name=$type; }
Flags: D - dynamic, X - disabled, R - running, S - slave
 #     NAME                                TYPE       ACTUAL-MTU L2MTU

Ups! Nothing?
Even if the variable name ($type) matches whatever property name (type=)
things go wrong.

The answer from MikroTik support (in Ticket#2019010222000454):

> This is how scripting works in RouterOS and we will not fix it.

To get around this we use variable names in CamelCase. Let's hope
Mikrotik never ever introduces property names in CamelCase...

*fingers crossed*
2019-01-04 12:35:34 +01:00
Christian Hesse
7d06a7e8c2 global-{config,functions}: move variables, make independent 2019-01-03 16:09:03 +01:00
Christian Hesse
6e03a3b935 script-updates: add configuration versioning 2019-01-03 15:36:26 +01:00
Christian Hesse
0f72662745 dhcp-to-dns: give time in short format
Note that a unit is required to make it a time value!
2019-01-03 10:28:23 +01:00
Christian Hesse
93a6bff312 daily-psk-schedule: give time in short format
Note that a unit is required to make it a time value!
2019-01-03 10:23:02 +01:00
Christian Hesse
fe04b8b8db rename script 'check-lte-firmware-update' -> 'check-lte-firmware-upgrade'
That's the correct wording from commands..
2019-01-02 22:50:23 +01:00
Christian Hesse
e2b5124e8c add script 'unattended-lte-firmware-upgrade' 2019-01-02 22:50:23 +01:00
Christian Hesse
29a363649d add template for script documentation 2019-01-02 21:31:59 +01:00
Christian Hesse
99e92340bc README: add link to scroll up 2019-01-02 21:04:54 +01:00
Christian Hesse
7f7a9d8c89 ignore all html files 2019-01-02 16:26:32 +01:00
Christian Hesse
dfa750a7f5 Makefile: update links for generated html 2019-01-02 16:22:14 +01:00
Christian Hesse
e27a4e8f0e Makefile: update for extended functionality
This can handle new and multiple markdown files.
2019-01-02 15:41:00 +01:00
Christian Hesse
bc36fb74c3 update-tunnelbroker: verify certificate 2019-01-02 15:02:42 +01:00
Michael Gisbers
ca16f286ef update-tunnelbroker: move configuration to global-config...
... and get the external ip address from cloud.

Signed-off-by: Michael Gisbers <michael@gisbers.de>
Signed-off-by: Christian Hesse <mail@eworm.de>
2019-01-02 15:02:42 +01:00
Michael Gisbers
69e76f5ecc capsman-download-packages: use upgrade command to force remote-cap upgrade
Signed-off-by: Michael Gisbers <michael@gisbers.de>
Signed-off-by: Christian Hesse <mail@eworm.de>
2019-01-02 15:02:42 +01:00
Christian Hesse
688c757df0 check-routeros-update: be more verbose on error 2019-01-02 15:02:42 +01:00
Christian Hesse
a19f15c515 check-routeros-update: do not fail if safe-update-url return error
We still want the notification...
2019-01-02 15:02:42 +01:00
Christian Hesse
472cd3d905 update copyright for 2019 2019-01-02 09:38:34 +01:00
Christian Hesse
3cdd0fb94b global-functions: properly define global functions 2018-12-28 22:56:29 +01:00
Christian Hesse
ea55464434 global-functions: update comment in $SendNotification 2018-12-28 22:56:29 +01:00
Christian Hesse
ac2e6cfc61 global-functions: add $DownloadPackage
... and make script 'capsman-download-packages' use it.
2018-12-28 22:56:07 +01:00
Christian Hesse
30166cc287 capsman-download-packages: move condition to loop 2018-12-28 18:50:22 +01:00
Christian Hesse
58d105da00 remove script 'remove-packages'
Use script 'capsman-download-packages' to download and
cleanup packages...
2018-12-27 21:50:17 +01:00
Christian Hesse
1131d8ee41 capsman-download-packages: act in package-path only 2018-12-27 21:42:30 +01:00
Christian Hesse
0ecb0749fd capsman-download-packages: do not restart service...
... but disconnect old CAPs and force reconnect with update.
2018-12-27 21:36:31 +01:00
Michael Gisbers
e1f5f7254a capsman-download-packages: rewrite package-name from wireless@ to wireless
Signed-off-by: Michael Gisbers <michael@gisbers.de>
Signed-off-by: Christian Hesse <mail@eworm.de>
2018-12-27 21:32:00 +01:00
Christian Hesse
ecc475af3e add script 'capsman-download-packages' 2018-12-27 02:19:27 +01:00
Christian Hesse
ee5eefefc3 global-functions: add $GetMacVendor 2018-12-27 00:48:56 +01:00
Christian Hesse
2505e5d42f remove-packages: delay if uptime less than one minute 2018-12-21 11:38:04 +01:00
Christian Hesse
f4673928ef global-functions: make $CertificateAvailable work on CommonName
This should prevent endless certificate switching for Let's Encrypt
cross-signed intermediate certificates.
2018-12-20 22:21:00 +01:00
Christian Hesse
abdc9b0cbd README: add Root CA certificate DST Root CA X3
This is used by Let's Encrypt to cross-sign.
2018-12-20 17:25:23 +01:00
Christian Hesse
44be3d8d07 check-certificates: support auto-renew of certificates 2018-12-20 15:55:40 +01:00
Christian Hesse
ee49fe3184 update-gre-address: remove settings from global-config
Instead read infos from gre interface comment.
2018-12-19 17:22:36 +01:00
Christian Hesse
9f077ab8bf ipv6-update: remove settings from global-config
Instead make it more robust by reading comments.
2018-12-19 16:48:34 +01:00
Christian Hesse
6f606f9ca5 email-backup: support cloud backup 2018-12-18 22:48:28 +01:00