Foodoor-Systemd-Service; Paketinstaller fragt nach oben/unten

This commit is contained in:
2022-11-01 18:56:45 +01:00
parent 0b34242781
commit bb8be95468
8 changed files with 36 additions and 168 deletions

View File

@ -1,5 +1,4 @@
#!/bin/bash
set -x
echo "Creating group and users.."
groupadd foodoor
useradd -M -d /var/lib/foodoor/close -G foodoor -s /bin/sh close
@ -12,11 +11,25 @@ for u in close open door; do
chown ${u}:${u} /var/lib/foodoor/${u}
done
echo "Chmod foodoor"
chmod 755 /var/lib/foodoor
echo "Create /state"
touch /state
chown root:foodoor /state
chmod 664 /state
echo "##################"
while [ "$prompt" != "oben" -a "$prompt" != "unten" ]; do
read -p "Sind wir oben oder unten? (oben, unten): " prompt
done
echo "##################"
echo "Installing dependencies via pip: pifacecommon pifacedigitalio"
pip install pifacecommon pifacedigitalio
echo "Enabling and starting systemd-Services"
systemctl daemon-reload
systemctl enable foodoord
systemctl restart foodoord
systemctl enable foodoord@$prompt
systemctl restart foodoord@$prompt
systemctl status foodoord@$prompt