Add user to sudo if requested
This commit is contained in:
parent
f7b9089707
commit
edda8ff56f
@ -14,5 +14,15 @@ else
|
|||||||
export username=$name
|
export username=$name
|
||||||
arch-chroot /mnt useradd -m $name
|
arch-chroot /mnt useradd -m $name
|
||||||
arch-chroot /mnt passwd $name
|
arch-chroot /mnt passwd $name
|
||||||
|
|
||||||
|
# If group "sudo" exists (=> sudo.flavour was installed), ask if the user should be added
|
||||||
|
if [ $(getent group sudo) ]; then
|
||||||
|
echo -n "~> Do you want to add $name to sudoers? (Y/n) "
|
||||||
|
read answer
|
||||||
|
if [ "$answer" == "y" ] || [ "$answer" == "Y" ]; then
|
||||||
|
usermod -a -G sudo $name
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
amf_return=0
|
amf_return=0
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user