You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
13 lines
396 B
13 lines
396 B
#!/bin/bash
|
|
|
|
while read line; do
|
|
user=$(echo "$line" | cut -d':' -f1)
|
|
# only create user if doesn't exist
|
|
if [[ -z $(getent passwd $user) ]]; then
|
|
adduser "$user" --disabled-password --gecos "" --no-create-home --shell /usr/sbin/nologin
|
|
usermod -a -G sambashare "$user"
|
|
fi
|
|
done < $1
|
|
|
|
# import passwords file
|
|
pdbedit -i smbpasswd:$1
|
|
|