This commit is contained in:
parent
7529832dea
commit
0f1740005a
5 changed files with 2 additions and 114 deletions
|
@ -8,18 +8,6 @@
|
|||
state: restarted
|
||||
daemon_reload: true
|
||||
|
||||
- name: Restart irc-photos
|
||||
ansible.builtin.systemd:
|
||||
name: irc-photos
|
||||
state: restarted
|
||||
daemon_reload: true
|
||||
|
||||
- name: Restart irc-doorduino
|
||||
ansible.builtin.systemd:
|
||||
name: irc-doorduino
|
||||
state: restarted
|
||||
daemon_reload: true
|
||||
|
||||
- name: restart discord-bot
|
||||
ansible.builtin.systemd:
|
||||
name: discord-bot
|
||||
|
|
|
@ -32,66 +32,3 @@
|
|||
state: started
|
||||
enabled: true
|
||||
daemon_reload: true
|
||||
|
||||
- name: Create helpers dir
|
||||
ansible.builtin.file:
|
||||
path: /var/lib/irc-helpers
|
||||
state: directory
|
||||
|
||||
- name: Install photos notification
|
||||
ansible.builtin.template:
|
||||
src: irc-photos.sh
|
||||
dest: /var/lib/irc-helpers/photos.sh
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0755
|
||||
notify: Restart irc-photos
|
||||
|
||||
- name: Install photos notification service
|
||||
ansible.builtin.template:
|
||||
src: generic.service
|
||||
dest: /etc/systemd/system/irc-photos.service
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
vars:
|
||||
description: Bitlair IRC photos notification
|
||||
requires: ircbot.service
|
||||
exec: /bin/bash /var/lib/irc-helpers/photos.sh
|
||||
notify: Restart irc-photos
|
||||
|
||||
- name: Start irc-photos
|
||||
ansible.builtin.systemd:
|
||||
name: irc-photos
|
||||
state: started
|
||||
enabled: true
|
||||
daemon_reload: true
|
||||
|
||||
- name: Install doorduino notification
|
||||
ansible.builtin.template:
|
||||
src: irc-doorduino.sh
|
||||
dest: /var/lib/irc-helpers/doorduino.sh
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0755
|
||||
notify: Restart irc-doorduino
|
||||
|
||||
- name: Install doorduino notification service
|
||||
ansible.builtin.template:
|
||||
src: generic.service
|
||||
dest: /etc/systemd/system/irc-doorduino.service
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
vars:
|
||||
description: Bitlair IRC doorduino notification
|
||||
requires: ircbot.service
|
||||
exec: /bin/bash /var/lib/irc-helpers/doorduino.sh
|
||||
notify: Restart irc-doorduino
|
||||
|
||||
- name: Start irc-doorduino
|
||||
ansible.builtin.systemd:
|
||||
name: irc-doorduino
|
||||
state: started
|
||||
enabled: true
|
||||
daemon_reload: true
|
||||
|
|
|
@ -13,8 +13,8 @@ DynamicUser=true
|
|||
Environment="MQTT_HOST={{ mqtt_internal_host }}"
|
||||
Environment="BOTTLECLIP_RESOURCES=/var/lib/bottle-clip"
|
||||
Environment="IRC_SERVER=irc.smurfnet.ch"
|
||||
Environment="IRC_CHANNEL=#bitlair-bot-test"
|
||||
Environment="IRC_NICK=Bitlair"
|
||||
Environment="IRC_CHANNEL=#bitlair"
|
||||
Environment="IRC_NICK=bitlair"
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
|
|
@ -1,24 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Managed by Ansible
|
||||
|
||||
set -eu
|
||||
set -o pipefail
|
||||
|
||||
initial=1
|
||||
|
||||
mqtt-simple -h {{ mqtt_internal_host }} -t "bitlair/doorduino/+" |
|
||||
while read line; do
|
||||
topic=$(echo "$line" | cut -d' ' -f1 | sed "s/bitlair\/doorduino\///")
|
||||
value=$(echo "$line" | cut -s -d' ' -f2-)
|
||||
|
||||
if [ $initial == 0 ] && [ $value != 0 ]; then
|
||||
if [ $topic == "doorbell" ]; then
|
||||
irc-say "DEURBEL! Open de deur beneden!"
|
||||
elif [ $topic != "dooropen" ]; then
|
||||
irc-say "Doorduino: $topic $value"
|
||||
fi
|
||||
fi
|
||||
initial=0
|
||||
done
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Managed by Ansible
|
||||
|
||||
set -eu
|
||||
set -o pipefail
|
||||
|
||||
mqtt-simple -h {{ mqtt_internal_host }} -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