mirror of
https://github.com/nymurbd/MikroTik-scripts.git
synced 2025-08-03 09:44:58 +02:00
mod/notification-matrix: add new configuration snippet...
... instead of appending to global-config-overlay.
This commit is contained in:
parent
e107247c16
commit
6f68406803
4 changed files with 14 additions and 8 deletions
Binary file not shown.
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 3.8 KiB |
Binary file not shown.
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 3.7 KiB |
|
@ -70,6 +70,9 @@ and write first part of the configuration:
|
|||
|
||||

|
||||
|
||||
The configuration is written to a new configuration snippet
|
||||
`global-config-overlay.d/mod/notification-matrix`.
|
||||
|
||||
#### Join Room
|
||||
|
||||
Every Matix chat is a room, so we have to create one. Do that with your
|
||||
|
@ -87,8 +90,8 @@ the invite.
|
|||
|
||||

|
||||
|
||||
The settings have been appended to `global-config-overlay`. You may want to
|
||||
edit to move it to an appropriate place.
|
||||
The configuration is appended to the configuration snippet
|
||||
`global-config-overlay.d/mod/notification-matrix`.
|
||||
|
||||
Usage and invocation
|
||||
--------------------
|
||||
|
|
|
@ -217,12 +217,14 @@
|
|||
}
|
||||
|
||||
:do {
|
||||
/system/script/set global-config-overlay source=([ get global-config-overlay source ] . "\n" . \
|
||||
/system/script/remove [ find where name="global-config-overlay.d/mod/notification-matrix" ];
|
||||
/system/script/add name="global-config-overlay.d/mod/notification-matrix" source=( \
|
||||
"# configuration snippet: mod/notification-matrix\n\n" . \
|
||||
":global MatrixHomeServer \"" . $MatrixHomeServer . "\";\n" . \
|
||||
":global MatrixAccessToken \"" . $MatrixAccessToken . "\";\n");
|
||||
$LogPrint info $0 ("Appended configuration to global-config-overlay. Now create and join a room, please!");
|
||||
$LogPrint info $0 ("Added configuration snippet. Now create and join a room, please!");
|
||||
} on-error={
|
||||
$LogPrint error $0 ("Failed appending configuration to global-config-overlay!");
|
||||
$LogPrint error $0 ("Failed adding configuration snippet!");
|
||||
:return false;
|
||||
}
|
||||
}
|
||||
|
@ -250,11 +252,12 @@
|
|||
}
|
||||
|
||||
:do {
|
||||
/system/script/set global-config-overlay source=([ get global-config-overlay source ] . "\n" . \
|
||||
:local Snippet [ /system/script/find where name="global-config-overlay.d/mod/notification-matrix" ];
|
||||
/system/script/set $Snippet source=([ get $Snippet source ] . \
|
||||
":global MatrixRoom \"" . $MatrixRoom . "\";\n");
|
||||
$LogPrint info $0 ("Appended configuration to global-config-overlay. Please review and cleanup!");
|
||||
$LogPrint info $0 ("Appended configuration to configuration snippet. Please review!");
|
||||
} on-error={
|
||||
$LogPrint error $0 ("Failed appending configuration to global-config-overlay!");
|
||||
$LogPrint error $0 ("Failed appending configuration to snippet!");
|
||||
:return false;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue