From 01cd5e8c401cb51fbb6a5ec3397a3e96bddb8836 Mon Sep 17 00:00:00 2001 From: silvernode Date: Fri, 29 Jan 2016 05:11:43 -0700 Subject: [PATCH] Added default groups, can now create password --- Bash Scripts/adduser.sh | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/Bash Scripts/adduser.sh b/Bash Scripts/adduser.sh index 870bd5e..581d926 100755 --- a/Bash Scripts/adduser.sh +++ b/Bash Scripts/adduser.sh @@ -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