services/irc-bot: Add WIP Cam relay

This commit is contained in:
polyfloyd 2023-09-10 18:20:49 +02:00
parent c94f9179c5
commit 1a26f81be6
4 changed files with 65 additions and 0 deletions

View file

@ -0,0 +1,16 @@
# Managed by Ansible
[Unit]
Description=Bitlair IRC photos notification
After=network.target
Requires=irc-bot.service
[Service]
Type=simple
ExecStart=/bin/bash /var/lib/irc-helpers/photos.sh
Restart=on-failure
RestartSec=10s
DynamicUser=true
[Install]
WantedBy=multi-user.target

View file

@ -0,0 +1,13 @@
#!/bin/basho
# Managed by Ansible
set -eu
set -o pipefail
mqtt-simple -h mqtt.bitlair.nl -s "bitlair/photos" |
while read event; do
path=$(echo $event | cut -d ' ' -f 2)
url="https://bitlair.nl/fotos/view/$path"
irc-say "WIP: $url"
done