services/irc-bot: Add WIP Cam relay
This commit is contained in:
parent
c94f9179c5
commit
1a26f81be6
4 changed files with 65 additions and 0 deletions
16
roles/services/templates/irc-photos.service
Normal file
16
roles/services/templates/irc-photos.service
Normal 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
|
13
roles/services/templates/irc-photos.sh
Normal file
13
roles/services/templates/irc-photos.sh
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue