summaryrefslogtreecommitdiffstats
path: root/krebs/2configs/shack
diff options
context:
space:
mode:
Diffstat (limited to 'krebs/2configs/shack')
-rwxr-xr-xkrebs/2configs/shack/doorstatus.sh2
-rw-r--r--krebs/2configs/shack/reaktor.nix15
2 files changed, 16 insertions, 1 deletions
diff --git a/krebs/2configs/shack/doorstatus.sh b/krebs/2configs/shack/doorstatus.sh
index 11e710cfd..46314cb9c 100755
--- a/krebs/2configs/shack/doorstatus.sh
+++ b/krebs/2configs/shack/doorstatus.sh
@@ -54,7 +54,7 @@ Herr makefu an Kasse 3 bitte, Kasse 3 bitte Herr makefu. Der API Computer ist ma
EOF
)
-state=$(curl https://api.shackspace.de/v1/space | jq .doorState.open)
+state=$(curl -fSsk https://api.shackspace.de/v1/space | jq .doorState.open)
prevstate=$(cat state ||:)
if test "$state" == "$(cat state)";then
diff --git a/krebs/2configs/shack/reaktor.nix b/krebs/2configs/shack/reaktor.nix
index a31c7a687..1f723c8e6 100644
--- a/krebs/2configs/shack/reaktor.nix
+++ b/krebs/2configs/shack/reaktor.nix
@@ -14,6 +14,21 @@
];
};
}
+ {
+ plugin = "system";
+ config = {
+ hooks.PRIVMSG = [
+ {
+ pattern = ''\.open\??$|\.offen\??$'';
+ activate = "match";
+ command.filename = pkgs.writers.writeDash "is_shack_open" ''
+ ${pkgs.curl}/bin/curl -fSsk https://api.shackspace.de/v1/space |
+ ${pkgs.jq}/bin/jq '.doorState.open'
+ '';
+ }
+ ];
+ };
+ }
];
};
systemd.services.announce_doorstatus = {