Added default groups, can now create password
This commit is contained in:
parent
b0ce38a64d
commit
01cd5e8c40
@ -1,15 +1,35 @@
|
||||
#!/bin/bash
|
||||
|
||||
|
||||
|
||||
Create_user(){
|
||||
|
||||
echo
|
||||
echo -n "Username: "
|
||||
read uname
|
||||
|
||||
useradd -m -G wheel,storage,audio,video,optical,lp,network,dbus,xbuilder -s /bin/bash ${uname}
|
||||
|
||||
echo "Additional Groups: "
|
||||
echo
|
||||
|
||||
echo "[1] - Arch Linux Defaults"
|
||||
echo "[2] - Void Linux Defaults"
|
||||
echo "[3] - Custom"
|
||||
read dgroups
|
||||
|
||||
if [ "${dgroups}" = "1" ];then
|
||||
addgroups="power, wheel, optical network, video, audio, storage"
|
||||
elif [ "${dgroups}" = "2" ];then
|
||||
addgroups="wheel,storage,audio,video,optical,lp,network,dbus,xbuilder"
|
||||
elif [ "${dgroups}" = "3" ];then
|
||||
echo -n "Enter desired groups (comma separated): "
|
||||
read custgroups
|
||||
addgroups="${custgroups}"
|
||||
fi
|
||||
echo "${addgroups}"
|
||||
read -n 1 -p "wait"
|
||||
useradd -m -g users -G ${dgroups} -s /bin/bash ${uname}
|
||||
passwd
|
||||
echo
|
||||
|
||||
if [ -d /home/${uname} ];then
|
||||
echo "User ${uname} created"
|
||||
else
|
||||
|
Loading…
x
Reference in New Issue
Block a user