Added service
This commit is contained in:
parent
10c570b552
commit
c742c91682
@ -13,7 +13,7 @@ while $(true); do
|
|||||||
if [[ "$state" = "false" ]]; then
|
if [[ "$state" = "false" ]]; then
|
||||||
|
|
||||||
echo "Porte ouverte, 30 secondes avant l'ouverture du local"
|
echo "Porte ouverte, 30 secondes avant l'ouverture du local"
|
||||||
sleep 3
|
sleep 30
|
||||||
if [[ "$(isClosed)" = "false" ]]; then
|
if [[ "$(isClosed)" = "false" ]]; then
|
||||||
systemctl start lol-opening.service
|
systemctl start lol-opening.service
|
||||||
fi
|
fi
|
||||||
@ -21,7 +21,7 @@ while $(true); do
|
|||||||
else
|
else
|
||||||
|
|
||||||
echo "Porte fermee, 10 secondes avant la fermeture du local"
|
echo "Porte fermee, 10 secondes avant la fermeture du local"
|
||||||
sleep 1
|
sleep 10
|
||||||
if [[ "$(isClosed)" = "true" ]]; then
|
if [[ "$(isClosed)" = "true" ]]; then
|
||||||
systemctl stop lol-opening.service
|
systemctl stop lol-opening.service
|
||||||
fi
|
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