From a3eb271e3f831d9ec66f0edbeb6fdf6fdb488e2a Mon Sep 17 00:00:00 2001 From: i-c-u-p <96894903+i-c-u-p@users.noreply.github.com> Date: Thu, 28 Apr 2022 23:28:49 +0000 Subject: [PATCH] shorten sudoers regex for removing comments (properly this time) overreacted a bit in 1e4f7b6. the shortenings only "broadened the match" because in b07be8b i removed "^# " from the start of what gets matched. this commit shortens them without doing that. --- scripts/1-setup.sh | 4 ++-- scripts/3-post-setup.sh | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/1-setup.sh b/scripts/1-setup.sh index a37d8a4..4ca3db2 100755 --- a/scripts/1-setup.sh +++ b/scripts/1-setup.sh @@ -56,8 +56,8 @@ ln -s /usr/share/zoneinfo/${TIMEZONE} /etc/localtime localectl --no-ask-password set-keymap ${KEYMAP} # Add sudo no password rights -sed -i 's/^# %wheel ALL=(ALL) NOPASSWD: ALL/%wheel ALL=(ALL) NOPASSWD: ALL/' /etc/sudoers -sed -i 's/^# %wheel ALL=(ALL:ALL) NOPASSWD: ALL/%wheel ALL=(ALL:ALL) NOPASSWD: ALL/' /etc/sudoers +sed -i '/^# %wheel ALL=(ALL) NOPASSWD: ALL/s/^# //' /etc/sudoers +sed -i '/^# %wheel ALL=(ALL:ALL) NOPASSWD: ALL/s/^# //' /etc/sudoers #Add parallel downloading sed -i '/^#ParallelDownloads/s/^.//' /etc/pacman.conf diff --git a/scripts/3-post-setup.sh b/scripts/3-post-setup.sh index 4216e1a..9c5bfec 100755 --- a/scripts/3-post-setup.sh +++ b/scripts/3-post-setup.sh @@ -147,8 +147,8 @@ echo " sed -i 's/^%wheel ALL=(ALL) NOPASSWD: ALL/# &/' /etc/sudoers sed -i 's/^%wheel ALL=(ALL:ALL) NOPASSWD: ALL/# &/' /etc/sudoers # Add sudo rights -sed -i 's/^# %wheel ALL=(ALL) ALL/%wheel ALL=(ALL) ALL/' /etc/sudoers -sed -i 's/^# %wheel ALL=(ALL:ALL) ALL/%wheel ALL=(ALL:ALL) ALL/' /etc/sudoers +sed -i '/^# %wheel ALL=(ALL) ALL/s/^# //' /etc/sudoers +sed -i '/^# %wheel ALL=(ALL:ALL) ALL/s/^# //' /etc/sudoers rm -r $HOME/ArchTitus /home/$USERNAME/ArchTitus