samba.sh fix import option thanks @hugochinchilla

This commit is contained in:
David Personette 2015-06-18 08:41:45 -04:00
parent ab15aae77d
commit 682b2d769c

View File

@ -22,10 +22,10 @@ set -o nounset # Treat unset variables as an error
# Arguments:
# file) file to import
# Return: user(s) added to container
import() { local name file="${2}"
for name in $(cat $file | cut -d: -f1); do
useradd "$name" -M
done
import() { local name id file="${1}"
while read name id; do
useradd "$name" -M -u "$id"
done < <(cut -d: -f1,2 --output-delimiter=' ' $file)
pdbedit -i smbpasswd:$file
}