samba.sh derp2

This commit is contained in:
David Personette 2017-12-21 10:32:29 -05:00
parent 2675311ab8
commit 6d8895966c

View File

@ -51,7 +51,7 @@ global() { local key="${1%%=*}" value="${1#*=}" file=/etc/samba/smb.conf
# Return: user(s) added to container # Return: user(s) added to container
import() { local name id file="$1" import() { local name id file="$1"
while read name id; do while read name id; do
grep -q "^$user:" /etc/passwd || adduser -D -H -u "$id" "$name" grep -q "^$name:" /etc/passwd || adduser -D -H -u "$id" "$name"
done < <(cut -d: -f1,2 $file | sed 's/:/ /') done < <(cut -d: -f1,2 $file | sed 's/:/ /')
pdbedit -i smbpasswd:$file pdbedit -i smbpasswd:$file
} }