Commit graph

53 commits

Author SHA1 Message Date
Christian Hesse
628ae1bd70 bridge-port-to-default: use $ParseKeyValueStore...
... and unbreak last commit removing delay (69352c90).
This requires a change in configuration syntax. Change this...

    comment="default:br-local, alt:br-guest"

to...

    comment="default=br-local, alt=br-guest"
2020-03-03 13:32:00 +01:00
Christian Hesse
b5f4c2c87e global-config: drop $ScriptUpdatesConfigChangesIgnore
Comment or remove $GlobalConfigVersion in global-config-overlay
to disable change notifications.
2020-02-04 20:19:46 +01:00
Christian Hesse
1e72f03e5e README: update instructions to use $ScriptInstallUpdate 2020-01-29 22:14:56 +01:00
Christian Hesse
afb9839073 update copyright for 2020 2020-01-01 17:00:39 +01:00
Christian Hesse
df0c2afa31 check-health: decrease default threshold for voltage 2019-10-22 15:03:52 +02:00
Christian Hesse
f40bb2c8c8 check-health: make threshold for voltage configurable 2019-10-14 19:13:31 +02:00
Christian Hesse
1cee36a911 introduce global-config-overlay 2019-09-12 21:29:41 +02:00
Christian Hesse
166bbffe1d script-updates: add donation hint in configuration warning notification 2019-08-30 14:10:58 +02:00
Christian Hesse
05f2d03ad9 use shorter url for my repository 2019-08-30 13:43:21 +02:00
Christian Hesse
29dc1b8841 add script 'check-health'
This may be incomplete... Please report if you have missing PSUs,
ttemperature sensors, whatever.
2019-08-27 12:01:32 +02:00
Christian Hesse
8d1313f588 add script 'upload-backup' 2019-07-19 11:46:29 +02:00
Christian Hesse
26f01b238b global-config: move config for email-backup
Signed-off-by: Christian Hesse <mail@eworm.de>
2019-07-19 11:46:29 +02:00
Christian Hesse
5101d57d52 backup: split off cloud-backup
Currently backup to MikroTik cloud is pretty unreliable and script can
not catch errors at runtime. Looks like this does not change any time
soon (Ticket#2019052022003204).

So let's just split off the cloud backup to make sure email backup works
as expected.
2019-06-14 15:13:41 +02:00
Christian Hesse
15d3e9ea7b global-config: change duplicate word from daily psk 2019-04-05 07:56:50 +02:00
Christian Hesse
7b1c275cc2 script-updates: add option to ignore global-config changes 2019-04-02 08:48:35 +02:00
Christian Hesse
594aef2aab check-certificates: support multiple passphrases 2019-04-01 22:45:38 +02:00
Christian Hesse
1cd7679a07 update-tunnelbroker: get tunnelbroker config from interface comment 2019-01-04 20:20:20 +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
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
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
Christian Hesse
472cd3d905 update copyright for 2019 2019-01-02 09:38:34 +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
Christian Hesse
9346df67d7 add script 'check-lte-firmware-update' 2018-12-14 23:04:18 +01:00
Christian Hesse
6e4d715937 global-functions: add identity tag in $SendNotification
... and send subject in telegram message.
2018-11-28 21:19:39 +01:00
Christian Hesse
c4f8c1ad52 global-config: add identity tag 2018-11-26 13:45:02 +01:00
Christian Hesse
015f8e01b5 global-config: sort sms-action alphabetically 2018-11-13 10:20:45 +01:00
Christian Hesse
e17389749f global-config: add more examples for mode button and sms-action 2018-11-13 10:20:14 +01:00
Christian Hesse
7aae1bf9dd global-config: default for telegram is empty strings...
... to make sure the api is not flooded with invalid requests.
2018-10-10 10:22:18 +02:00
Christian Hesse
5e4ef0ab8f global-functions: add function to notify via e-mail and telegram 2018-10-09 15:46:39 +02:00
Christian Hesse
977a5d5f5e global-functions: move daily psk secrets to global-config 2018-10-09 14:17:19 +02:00
Christian Hesse
7b4bef1a1e make GeneratePSK a global function 2018-10-09 14:15:34 +02:00
Christian Hesse
9c3f3b9f20 add global-functions 2018-10-09 14:15:34 +02:00
Christian Hesse
311475e67c add script 'bridge-port-toggle'
... to toggle between configuration 'default' and 'alt'.
2018-10-04 14:03:09 +02:00
Christian Hesse
17f64b48af bridge-port-to-default: support different configurations
Just add something like this to your bridge ports:

comment="default:br-ext,alt:br-intern"
2018-10-04 13:56:09 +02:00
Christian Hesse
ea4b739d00 global-config: add missing semicolons 2018-10-04 13:32:21 +02:00
Christian Hesse
be673737d3 start scripts with a magic token / shebang 2018-09-27 00:18:43 +02:00
Christian Hesse
5fff04ed0e fix typos 2018-09-13 22:25:38 +02:00
Christian Hesse
95794d0367 sms-action: move configuration to global-config 2018-09-13 22:07:12 +02:00
Christian Hesse
172d789f2a add scripts mode-button-{event,scheduler} 2018-09-10 22:15:54 +02:00
Christian Hesse
2de26a6617 check-routeros-update: enable auto update for safe version 2018-09-05 23:45:35 +02:00
Christian Hesse
23b167e84b check-routeros-update: resend notification if version changes 2018-08-30 11:14:01 +02:00
Christian Hesse
21f2b04f9a script-updates: add support for url suffix
This allows to fetch from different branch...
2018-08-27 11:15:03 +02:00
Christian Hesse
07e54dd88b add empty comment at first line...
... for better formatting in export.
2018-08-24 16:58:30 +02:00
Christian Hesse
2ec96e9db4 add script 'gps-track' 2018-08-06 14:21:55 +02:00
Christian Hesse
a80591f510 script-updates: always accept updates from file 2018-07-10 00:05:30 +02:00