mirror of
https://github.com/classy-giraffe/easy-arch.git
synced 2025-11-17 11:30:55 +00:00
Ask for normal user account
This commit is contained in:
parent
80ffc96f99
commit
225b50839c
1 changed files with 11 additions and 0 deletions
11
easy-arch.sh
11
easy-arch.sh
|
|
@ -154,6 +154,9 @@ genfstab -U /mnt >> /mnt/etc/fstab
|
|||
read -r -p "Please enter the hostname: " hostname
|
||||
echo "$hostname" > /mnt/etc/hostname
|
||||
|
||||
# Setting username.
|
||||
read -r -p "Please enter name for a user account (enter empty to not create one): " username
|
||||
|
||||
# Setting up locales.
|
||||
read -r -p "Please insert the locale you use (format: xx_XX): " locale
|
||||
echo "$locale.UTF-8 UTF-8" > /mnt/etc/locale.gen
|
||||
|
|
@ -213,11 +216,19 @@ arch-chroot /mnt /bin/bash -e <<EOF
|
|||
echo "Creating GRUB config file."
|
||||
grub-mkconfig -o /boot/grub/grub.cfg &>/dev/null
|
||||
|
||||
# Adding user with sudo privilege
|
||||
if [ -n "$username" ]; then
|
||||
echo "Adding $username with root privilege."
|
||||
useradd -m $username
|
||||
usermod -aG wheel $username
|
||||
echo "$username ALL=(ALL) ALL" >> /etc/sudoers.d/$username
|
||||
fi
|
||||
EOF
|
||||
|
||||
# Setting root password.
|
||||
echo "Setting root password."
|
||||
arch-chroot /mnt /bin/passwd
|
||||
[ -n "$username" ] && echo "Setting user password for ${username}." && arch-chroot /mnt /bin/passwd $username
|
||||
|
||||
# Enabling Reflector timer.
|
||||
echo "Enabling Reflector."
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue