mirror of
https://git.clerie.de/clerie/fieldpoc.git
synced 2026-01-03 06:18:12 +00:00
Make nerd example config use HTTP REST API for reloading
This commit is contained in:
parent
b820eaff52
commit
3197e4f8d3
1 changed files with 2 additions and 11 deletions
|
|
@ -15,19 +15,10 @@ It downloads the JSON file, copies it to the location FieldPOC expects the exten
|
||||||
systemd.services.fieldpoc-nerd = {
|
systemd.services.fieldpoc-nerd = {
|
||||||
wantedBy = ["multi-user.target"];
|
wantedBy = ["multi-user.target"];
|
||||||
startAt = "*-*-* *:*:00";
|
startAt = "*-*-* *:*:00";
|
||||||
script = let
|
script = ''
|
||||||
reloadScript = pkgs.writeText "reload" ''
|
|
||||||
spawn ${pkgs.inetutils}/bin/telnet localhost 9437
|
|
||||||
expect "> "
|
|
||||||
send "reload\n"
|
|
||||||
expect "> "
|
|
||||||
send "exit\n"
|
|
||||||
expect "disconnecting"
|
|
||||||
'';
|
|
||||||
in ''
|
|
||||||
${pkgs.curl}/bin/curl https://nerd.example.com/export.json\?event=1 > /etc/fieldpoc/extensions.json
|
${pkgs.curl}/bin/curl https://nerd.example.com/export.json\?event=1 > /etc/fieldpoc/extensions.json
|
||||||
|
|
||||||
${pkgs.expect}/bin/expect ${reloadScript}
|
${pkgs.curl}/bin/curl --json '{}' http://127.0.0.1:9437/reload
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
```
|
```
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue