29 lines
624 B
Bash
Executable File
29 lines
624 B
Bash
Executable File
#!/bin/bash
|
|
|
|
GROUP=doorparty
|
|
GID=1000
|
|
USERS=/etc/doorparty-connector.users
|
|
|
|
set -e
|
|
|
|
export PATH=$PATH:${SBBSEXEC}
|
|
|
|
if [ -r ${USERS} ]; then
|
|
if ! grep -qe ^${GROUP}: /etc/group; then
|
|
groupadd -g ${GID} ${GROUP}
|
|
fi
|
|
|
|
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
|
|
|
|
([ -d /run/sshd ] || mkdir /run/sshd) && /usr/sbin/sshd
|
|
fi
|
|
|
|
exec /sbin/doorparty-connector /etc/doorparty-connector.ini
|