From 1cdc93bd2da7885558a78fa89537600782c1a9eb Mon Sep 17 00:00:00 2001 From: David Personette Date: Tue, 30 Aug 2016 06:01:21 -0400 Subject: [PATCH] README.md / samba.sh add optional ID argument to user creation --- README.md | 1 + samba.sh | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4ab78d6..726aa32 100644 --- a/README.md +++ b/README.md @@ -50,6 +50,7 @@ OR set local storage: required arg: ";" for user for user + [ID] for user -w "" Configure the workgroup (domain) samba should use required arg: "" for samba diff --git a/samba.sh b/samba.sh index a65ec70..b909b41 100755 --- a/samba.sh +++ b/samba.sh @@ -88,9 +88,10 @@ timezone() { local timezone="${1:-EST5EDT}" # Arguments: # name) for user # password) for user +# id) for user # Return: user added to container -user() { local name="${1}" passwd="${2}" - useradd "$name" -M +user() { local name="${1}" passwd="${2}" id="${3:-""}" + useradd "$name" -M ${id:+-u $id} echo "$passwd" | tee - | smbpasswd -s -a "$name" } @@ -130,6 +131,7 @@ Options (fields in '[]' are optional, '<>' are required): required arg: \";\" for user for user + [ID] for user -w \"\" Configure the workgroup (domain) samba should use required arg: \"\" for samba