Skip to content

Commit

Permalink
Add sudoers config
Browse files Browse the repository at this point in the history
  • Loading branch information
felixschndr committed Oct 19, 2024
1 parent f3bd7be commit f80cae4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions Configurations/sudoers_no_password
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
%sudo ALL=(ALL) NOPASSWD: ALL
12 changes: 12 additions & 0 deletions install
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,17 @@ if command -v lazygit >/dev/null 2>&1; then
ln -sf "${repoLocation}/Configurations/lazygit.yml" "/home/${USER}/.config/lazygit/config.yml"
fi

if [[ $(cat /proc/version 2>/dev/null) =~ (M|m)icrosoft ]]; then
echo -n "WSL detected, do you want to install the suders configuration that allows the usage of no password for elevated commands? [y/N] "
read -r -N 1 answer
if [[ $answer =~ ^[Yy]$ ]]; then
echo -e "\nInstalling sudoers configuration..."
# No linking possible since the config file has to broad permissions
sudo cp "${repoLocation}/Configurations/sudoers_no_password" "/etc/sudoers.d/"
else
echo "Skipping sudoers configuration..."
fi
fi

echo "Finished 🎉"
exit 0

0 comments on commit f80cae4

Please sign in to comment.