README.md / samba.sh add optional ID argument to user creation
This commit is contained in:
parent
11eb428a88
commit
1cdc93bd2d
@ -50,6 +50,7 @@ OR set local storage:
|
|||||||
required arg: "<username>;<passwd>"
|
required arg: "<username>;<passwd>"
|
||||||
<username> for user
|
<username> for user
|
||||||
<password> for user
|
<password> for user
|
||||||
|
[ID] for user
|
||||||
-w "<workgroup>" Configure the workgroup (domain) samba should use
|
-w "<workgroup>" Configure the workgroup (domain) samba should use
|
||||||
required arg: "<workgroup>"
|
required arg: "<workgroup>"
|
||||||
<workgroup> for samba
|
<workgroup> for samba
|
||||||
|
6
samba.sh
6
samba.sh
@ -88,9 +88,10 @@ timezone() { local timezone="${1:-EST5EDT}"
|
|||||||
# Arguments:
|
# Arguments:
|
||||||
# name) for user
|
# name) for user
|
||||||
# password) for user
|
# password) for user
|
||||||
|
# id) for user
|
||||||
# Return: user added to container
|
# Return: user added to container
|
||||||
user() { local name="${1}" passwd="${2}"
|
user() { local name="${1}" passwd="${2}" id="${3:-""}"
|
||||||
useradd "$name" -M
|
useradd "$name" -M ${id:+-u $id}
|
||||||
echo "$passwd" | tee - | smbpasswd -s -a "$name"
|
echo "$passwd" | tee - | smbpasswd -s -a "$name"
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -130,6 +131,7 @@ Options (fields in '[]' are optional, '<>' are required):
|
|||||||
required arg: \"<username>;<passwd>\"
|
required arg: \"<username>;<passwd>\"
|
||||||
<username> for user
|
<username> for user
|
||||||
<password> for user
|
<password> for user
|
||||||
|
[ID] for user
|
||||||
-w \"<workgroup>\" Configure the workgroup (domain) samba should use
|
-w \"<workgroup>\" Configure the workgroup (domain) samba should use
|
||||||
required arg: \"<workgroup>\"
|
required arg: \"<workgroup>\"
|
||||||
<workgroup> for samba
|
<workgroup> for samba
|
||||||
|
Loading…
Reference in New Issue
Block a user