Added service
This commit is contained in:
parent
10c570b552
commit
c742c91682
@ -13,7 +13,7 @@ while $(true); do
|
||||
if [[ "$state" = "false" ]]; then
|
||||
|
||||
echo "Porte ouverte, 30 secondes avant l'ouverture du local"
|
||||
sleep 3
|
||||
sleep 30
|
||||
if [[ "$(isClosed)" = "false" ]]; then
|
||||
systemctl start lol-opening.service
|
||||
fi
|
||||
@ -21,7 +21,7 @@ while $(true); do
|
||||
else
|
||||
|
||||
echo "Porte fermee, 10 secondes avant la fermeture du local"
|
||||
sleep 1
|
||||
sleep 10
|
||||
if [[ "$(isClosed)" = "true" ]]; then
|
||||
systemctl stop lol-opening.service
|
||||
fi
|
||||
|
10
mqtt-lol-opener.service
Normal file
10
mqtt-lol-opener.service
Normal file
@ -0,0 +1,10 @@
|
||||
[Unit]
|
||||
Description=Ouverture automatique du local via mqtt
|
||||
Require=network.target
|
||||
|
||||
[Service]
|
||||
ExecStart=/opt/mqtt-lol-opener/lol-opener.sh
|
||||
Type=exec
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
Loading…
x
Reference in New Issue
Block a user