samba.sh derp

This commit is contained in:
David Personette 2017-12-20 06:17:44 -05:00
parent eb6c282bac
commit 2675311ab8

View File

@ -126,7 +126,7 @@ smb() { local file=/etc/samba/smb.conf
# Return: user added to container # Return: user added to container
user() { local name="${1}" passwd="${2}" id="${3:-""}" group="${4:-""}" user() { local name="${1}" passwd="${2}" id="${3:-""}" group="${4:-""}"
[[ "$group" ]] && { grep -q "^$group:" /etc/group || addgroup "$group"; } [[ "$group" ]] && { grep -q "^$group:" /etc/group || addgroup "$group"; }
grep -q "^$user:" /etc/passwd || grep -q "^$name:" /etc/passwd ||
adduser -D -H ${group:+-G $group} ${id:+-u $id} "$name" adduser -D -H ${group:+-G $group} ${id:+-u $id} "$name"
echo -e "$passwd\n$passwd" | smbpasswd -s -a "$name" echo -e "$passwd\n$passwd" | smbpasswd -s -a "$name"
} }