Code style and shellcheck

This commit is contained in:
T
2024-06-07 22:17:06 +02:00
parent bb8be95468
commit 5724fcad2a
8 changed files with 264 additions and 283 deletions

View File

@ -1,4 +1,5 @@
#!/bin/bash
echo "Creating group and users.."
groupadd foodoor
useradd -M -d /var/lib/foodoor/close -G foodoor -s /bin/sh close
@ -7,8 +8,8 @@ useradd -M -d /var/lib/foodoor/door -G foodoor -s /bin/sh door
echo "Chown homes"
for u in close open door; do
groupadd ${u}
chown ${u}:${u} /var/lib/foodoor/${u}
groupadd ${u}
chown ${u}:${u} /var/lib/foodoor/${u}
done
echo "Chmod foodoor"
@ -20,8 +21,8 @@ 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
while [ "$prompt" != "oben" ] && [ "$prompt" != "unten" ]; do
read -r -p "Sind wir oben oder unten? (oben, unten): " prompt
done
echo "##################"
@ -30,6 +31,6 @@ pip install pifacecommon pifacedigitalio
echo "Enabling and starting systemd-Services"
systemctl daemon-reload
systemctl enable foodoord@$prompt
systemctl restart foodoord@$prompt
systemctl status foodoord@$prompt
systemctl enable "foodoord@$prompt"
systemctl restart "foodoord@$prompt"
systemctl status "foodoord@$prompt"