mirror of
https://github.com/classy-giraffe/easy-arch.git
synced 2025-11-17 19:40:55 +00:00
simplify grub & sudoers sed expressions
This commit is contained in:
parent
c56fbb9878
commit
7797b19331
1 changed files with 2 additions and 2 deletions
|
|
@ -324,7 +324,7 @@ EOF
|
||||||
# Setting up LUKS2 encryption in grub.
|
# Setting up LUKS2 encryption in grub.
|
||||||
print "Setting up grub config."
|
print "Setting up grub config."
|
||||||
UUID=$(blkid -s UUID -o value $CRYPTROOT)
|
UUID=$(blkid -s UUID -o value $CRYPTROOT)
|
||||||
sed -i "s,^GRUB_CMDLINE_LINUX=\"\",GRUB_CMDLINE_LINUX=\"rd.luks.name=$UUID=cryptroot root=$BTRFS\",g" /mnt/etc/default/grub
|
sed -i "s,^GRUB_CMDLINE_LINUX=\",&rd.luks.name=$UUID=cryptroot root=$BTRFS\",g" /mnt/etc/default/grub
|
||||||
|
|
||||||
# Configuring the system.
|
# Configuring the system.
|
||||||
arch-chroot /mnt /bin/bash -e <<EOF
|
arch-chroot /mnt /bin/bash -e <<EOF
|
||||||
|
|
@ -373,7 +373,7 @@ echo "root:$rootpass" | arch-chroot /mnt chpasswd
|
||||||
if [ -n "$username" ]; then
|
if [ -n "$username" ]; then
|
||||||
print "Adding the user $username to the system with root privilege."
|
print "Adding the user $username to the system with root privilege."
|
||||||
arch-chroot /mnt useradd -m -G wheel -s /bin/bash "$username"
|
arch-chroot /mnt useradd -m -G wheel -s /bin/bash "$username"
|
||||||
sed -i 's/# %wheel ALL=(ALL) ALL/%wheel ALL=(ALL) ALL/' /mnt/etc/sudoers
|
sed -i '%wheel ALL=(ALL) ALL/s/^# //' /mnt/etc/sudoers
|
||||||
print "Setting user password for $username."
|
print "Setting user password for $username."
|
||||||
echo "$username:$userpass" | arch-chroot /mnt chpasswd
|
echo "$username:$userpass" | arch-chroot /mnt chpasswd
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue