From c58e725ca82d29c2fcd31e60e3361169292e8d70 Mon Sep 17 00:00:00 2001 From: i-c-u-p <96894903+i-c-u-p@users.noreply.github.com> Date: Mon, 25 Apr 2022 05:34:09 +0000 Subject: [PATCH] shorten some sed expressions use & for adding comments to patterns and use '//s/^# //' for uncommenting them --- scripts/3-post-setup.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/3-post-setup.sh b/scripts/3-post-setup.sh index c31cdab..336e359 100755 --- a/scripts/3-post-setup.sh +++ b/scripts/3-post-setup.sh @@ -151,11 +151,11 @@ echo -ne " ------------------------------------------------------------------------- " # Remove no password sudo 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 '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 rm -r /home/$USERNAME/ArchTitus