docker-samba-server/run.s6
2016-05-17 18:32:07 +01:00

14 lines
469 B
Plaintext

#!/usr/bin/with-contenv sh
if [ ! -f "${CONFIG}" ]; then
echo "ERROR: You must pass though a Samba config file at \"${CONFIG}\" or change \$CONFIG to the config file path"
exit 1
fi
addgroup -g ${GID} ${GROUP} > /dev/null 2&>1
adduser -S -G ${GROUP} -u ${UID} -H -D ${USERNAME}
echo "${PASSWORD}" | tee - | smbpasswd -s -c "${CONFIG}" -a ${USERNAME}
nmbd --foreground --log-stdout --configfile="${CONFIG}" &
smbd --foreground --log-stdout --configfile="${CONFIG}"