Add scripts for Bitlair and DJO
This commit is contained in:
parent
5b96a6be43
commit
239e6cec0e
27 changed files with 105 additions and 1 deletions
3
bitlair_closed.d/10_log
Executable file
3
bitlair_closed.d/10_log
Executable file
|
@ -0,0 +1,3 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
echo "Space closed on $(date)" >> /var/log/spacestate.log
|
3
bitlair_closed.d/10_mqtt
Executable file
3
bitlair_closed.d/10_mqtt
Executable file
|
@ -0,0 +1,3 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
mqtt-simple -r -h mqtt.bitlair.nl -p 'bitlair/state' -m 'closed'
|
7
bitlair_closed.d/20_ledboard_poweroff
Executable file
7
bitlair_closed.d/20_ledboard_poweroff
Executable file
|
@ -0,0 +1,7 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Switches off the led-board.
|
||||||
|
ssh root@bitpanel.bitlair.nl shutdown -h now
|
||||||
|
sleep 5
|
||||||
|
apc-switch 23 off
|
||||||
|
sleep 1
|
11
bitlair_closed.d/20_music_poweroff
Executable file
11
bitlair_closed.d/20_music_poweroff
Executable file
|
@ -0,0 +1,11 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
ssh -o ConnectTimeout=1 root@music.bitlair.nl shutdown -h now
|
||||||
|
sleep 5
|
||||||
|
apc-switch 13 2
|
||||||
|
|
||||||
|
# Amplifier and KVM switch
|
||||||
|
apc-switch 20 2
|
||||||
|
sleep 1
|
||||||
|
|
||||||
|
mqtt-simple -r -h mqtt.bitlair.nl -p 'bitlair/music/space/state' -m 'stopped'
|
7
bitlair_closed.d/20_phone_off
Executable file
7
bitlair_closed.d/20_phone_off
Executable file
|
@ -0,0 +1,7 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Switches off the phones.
|
||||||
|
poe-switch 1 2
|
||||||
|
sleep 1
|
||||||
|
poe-switch 2 2
|
||||||
|
sleep 1
|
3
bitlair_closed.d/20_statsdisplay_poweroff
Executable file
3
bitlair_closed.d/20_statsdisplay_poweroff
Executable file
|
@ -0,0 +1,3 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
ssh -o ConnectTimeout=1 root@statsbak.bitlair.nl shutdown -h now
|
3
bitlair_closed.d/80_irc
Executable file
3
bitlair_closed.d/80_irc
Executable file
|
@ -0,0 +1,3 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
irc-say "Bitlair is now closed"
|
3
bitlair_closed.d/80_twitter
Normal file
3
bitlair_closed.d/80_twitter
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
bitlair-tweet "We are closed."
|
3
bitlair_open.d/10_log
Executable file
3
bitlair_open.d/10_log
Executable file
|
@ -0,0 +1,3 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
echo "Space opened on $(date)" >> /var/log/spacestate.log
|
3
bitlair_open.d/10_mqtt
Executable file
3
bitlair_open.d/10_mqtt
Executable file
|
@ -0,0 +1,3 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
mqtt-simple -r -h mqtt.bitlair.nl -p 'bitlair/state' -m 'open'
|
6
bitlair_open.d/20_ledboard_poweron
Executable file
6
bitlair_open.d/20_ledboard_poweron
Executable file
|
@ -0,0 +1,6 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Switches on the led-board.
|
||||||
|
|
||||||
|
apc-switch 23 on
|
||||||
|
sleep 1
|
11
bitlair_open.d/20_music_poweron
Executable file
11
bitlair_open.d/20_music_poweron
Executable file
|
@ -0,0 +1,11 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Switches on the music computer.
|
||||||
|
apc-switch 13 off
|
||||||
|
sleep 5
|
||||||
|
apc-switch 13 on
|
||||||
|
sleep 1
|
||||||
|
|
||||||
|
# Amplifier and KVM switch
|
||||||
|
apc-switch 20 on
|
||||||
|
sleep 1
|
7
bitlair_open.d/20_phone_on
Executable file
7
bitlair_open.d/20_phone_on
Executable file
|
@ -0,0 +1,7 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Switches on the phones.
|
||||||
|
poe-switch 1 1
|
||||||
|
sleep 1
|
||||||
|
poe-switch 2 1
|
||||||
|
sleep 1
|
8
bitlair_open.d/20_statsdisplay_poweron
Executable file
8
bitlair_open.d/20_statsdisplay_poweron
Executable file
|
@ -0,0 +1,8 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Starts the computer displaying pretty graphs.
|
||||||
|
|
||||||
|
for i in {0..3}; do
|
||||||
|
wakeonlan '00:1e:c9:72:21:c4'
|
||||||
|
sleep 1
|
||||||
|
done
|
3
bitlair_open.d/80_irc
Executable file
3
bitlair_open.d/80_irc
Executable file
|
@ -0,0 +1,3 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
irc-say "Bitlair is now open!"
|
3
bitlair_open.d/80_twitter
Normal file
3
bitlair_open.d/80_twitter
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
bitlair-tweet "We are OPEN!"
|
3
djo_closed.d/10_mqtt
Executable file
3
djo_closed.d/10_mqtt
Executable file
|
@ -0,0 +1,3 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
mqtt-simple -r -h mqtt.bitlair.nl -p 'bitlair/state/djo' -m 'closed'
|
1
djo_closed.d/20_ledboard_poweroff
Symbolic link
1
djo_closed.d/20_ledboard_poweroff
Symbolic link
|
@ -0,0 +1 @@
|
||||||
|
../bitlair_closed.d/20_ledboard_poweroff
|
1
djo_closed.d/20_music_poweroff
Symbolic link
1
djo_closed.d/20_music_poweroff
Symbolic link
|
@ -0,0 +1 @@
|
||||||
|
../bitlair_closed.d/20_music_poweroff
|
1
djo_closed.d/20_statsdisplay_poweroff
Symbolic link
1
djo_closed.d/20_statsdisplay_poweroff
Symbolic link
|
@ -0,0 +1 @@
|
||||||
|
../bitlair_closed.d/20_statsdisplay_poweroff
|
3
djo_closed.d/80_irc
Executable file
3
djo_closed.d/80_irc
Executable file
|
@ -0,0 +1,3 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
echo "DJO is now open" | nc 127.0.0.1 31337
|
3
djo_open.d/10_mqtt
Executable file
3
djo_open.d/10_mqtt
Executable file
|
@ -0,0 +1,3 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
mqtt-simple -r -h mqtt.bitlair.nl -p 'bitlair/state/djo' -m 'open'
|
1
djo_open.d/20_ledboard_poweron
Symbolic link
1
djo_open.d/20_ledboard_poweron
Symbolic link
|
@ -0,0 +1 @@
|
||||||
|
../bitlair_open.d/20_ledboard_poweron
|
1
djo_open.d/20_music_poweron
Symbolic link
1
djo_open.d/20_music_poweron
Symbolic link
|
@ -0,0 +1 @@
|
||||||
|
../bitlair_open.d/20_music_poweron
|
1
djo_open.d/20_statsdisplay_poweron
Symbolic link
1
djo_open.d/20_statsdisplay_poweron
Symbolic link
|
@ -0,0 +1 @@
|
||||||
|
../bitlair_open.d/20_statsdisplay_poweron
|
3
djo_open.d/80_irc
Executable file
3
djo_open.d/80_irc
Executable file
|
@ -0,0 +1,3 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
echo "DJO is now open" | nc 127.0.0.1 31337
|
|
@ -38,7 +38,9 @@ def set_bit(name, bit):
|
||||||
|
|
||||||
|
|
||||||
def alarm_disarmed():
|
def alarm_disarmed():
|
||||||
return mqtt_get('bitlair/alarm', 'armed').split(' ')[0] == 'disarmed'
|
with open('/tmp/alarmdisarmed', 'r') as f:
|
||||||
|
return f.read() == '1'
|
||||||
|
# return mqtt_get('bitlair/alarm', 'armed').split(' ')[0] == 'disarmed'
|
||||||
|
|
||||||
def in_djo_time():
|
def in_djo_time():
|
||||||
times = [
|
times = [
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue