docker-samba/start
2016-01-20 20:40:16 -08:00

23 lines
423 B
Bash
Executable File

#!/bin/bash
trap 'kill $(jobs -p)' EXIT
# append shares to smb conf
cat /shares.txt >> /etc/samba/smb.conf
supervisord &
sleep 5
cat /users.txt | while read line ; do
USER=$(echo $line | cut -d ':' -f 1)
PASS=$(echo $line | cut -d ':' -f 2)
useradd "$USER"
usermod -aG smbusers "$USER"
(echo "$PASS" ; echo "$PASS") | smbpasswd -s -a "$USER"
done
echo "Waiting for $(jobs -p)..."
wait $(jobs -p)