Added default groups, can now create password
This commit is contained in:
parent
b0ce38a64d
commit
01cd5e8c40
@ -1,13 +1,33 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Create_user(){
|
Create_user(){
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo -n "Username: "
|
echo -n "Username: "
|
||||||
read uname
|
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
|
echo
|
||||||
|
|
||||||
if [ -d /home/${uname} ];then
|
if [ -d /home/${uname} ];then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user