#!/bin/bash echo "Creating group and users.." groupadd foodoor useradd -M -d /var/lib/foodoor/close -G foodoor -s /bin/sh close useradd -M -d /var/lib/foodoor/open -G foodoor -s /bin/sh open useradd -M -d /var/lib/foodoor/door -G foodoor -s /bin/sh door echo "Chown homes" for u in "close open door"; do chown ${u}:${u} ${u} done echo "Create /state" touch /state chgrp root:foodoor /state chmod 664 /state