shorten some sed expressions

use & for adding comments to patterns and use '/<pattern>/s/^# //' for uncommenting them
This commit is contained in:
i-c-u-p 2022-04-25 05:34:09 +00:00 committed by GitHub
parent 134fdf09d8
commit c58e725ca8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -151,11 +151,11 @@ echo -ne "
------------------------------------------------------------------------- -------------------------------------------------------------------------
" "
# Remove no password sudo rights # 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) 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:ALL) NOPASSWD: ALL/# &/' /etc/sudoers
# Add sudo rights # Add sudo rights
sed -i 's/^# %wheel ALL=(ALL) ALL/%wheel ALL=(ALL) ALL/' /etc/sudoers sed -i '/^# %wheel ALL=(ALL) ALL/s/^# //' /etc/sudoers
sed -i 's/^# %wheel ALL=(ALL:ALL) ALL/%wheel ALL=(ALL:ALL) ALL/' /etc/sudoers sed -i '/^# %wheel ALL=(ALL:ALL) ALL/s/^# //' /etc/sudoers
rm -r $HOME/ArchTitus rm -r $HOME/ArchTitus
rm -r /home/$USERNAME/ArchTitus rm -r /home/$USERNAME/ArchTitus