sbbs/doorparty.sh
2021-01-14 17:29:43 +11:00

22 lines
479 B
Bash
Executable File

#!/bin/sh
GROUP=doorparty
GID=1000
USERS=${SBBSCTRL}/doorparty-connector.users
if ! grep -qe ^${GROUP}: /etc/group; then
echo true
groupadd -g ${GID} ${GROUP}
fi
if [ -r ${USERS} ]; then
cat ${USERS} | while read line; do
user=$(echo ${line}|awk -F: '{print $1}')
if ! grep -qe ^${user}: /etc/passwd; then
echo "+ Adding Door Party User: ${user}"
useradd -c "Door Party User" -g ${GROUP} -MN -s /usr/sbin/nologin ${user}
echo -n $line | chpasswd
fi
done
fi