#!/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}"