From 2abb88a26da6b2a7191d1f217a869b9435c6b5fd Mon Sep 17 00:00:00 2001 From: Tommaso Chiti Date: Thu, 4 Nov 2021 19:29:51 +0100 Subject: [PATCH] Fixes. --- easy-arch.sh | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/easy-arch.sh b/easy-arch.sh index 1d9d5cd..0ec24e6 100644 --- a/easy-arch.sh +++ b/easy-arch.sh @@ -300,24 +300,17 @@ arch-chroot /mnt /bin/bash -e </dev/null - # Setting root password. - echo "Setting root password." - passwd - - # Adding user with sudo privileges. - 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. print "Setting root password." arch-chroot /mnt /bin/passwd + +# Setting user password. if [ -n "$username" ]; then + print "Adding $username with root privilege." + useradd -m -G wheel "$username" + print "$username ALL=(ALL) ALL" >> /etc/sudoers.d/"$username" print "Setting user password for $username." arch-chroot /mnt /bin/passwd "$username" fi @@ -349,7 +342,7 @@ max-zram-size = 8192 EOF # Enabling various services. -print "Enabling Reflector, automatic snapshots, BTRFS scrubbing and systemd-oomd" +print "Enabling Reflector, automatic snapshots, BTRFS scrubbing and systemd-oomd." for service in reflector.timer snapper-timeline.timer snapper-cleanup.timer btrfs-scrub@-.timer btrfs-scrub@home.timer btrfs-scrub@var-log.timer btrfs-scrub@\\x2esnapshots.timer grub-btrfs.path systemd-oomd do systemctl enable $service --root=/mnt &>/dev/null