This commit is contained in:
PaulVua
2025-05-23 11:02:06 +02:00
parent f40c105abf
commit 2bd74ca91a
3 changed files with 26 additions and 22 deletions

View File

@@ -100,7 +100,7 @@ fi
# Add sudo authorization (prevent duplicate entries)
info "Setting up sudo authorization..."
if ! sudo grep -q "/usr/bin/nmcli" /etc/sudoers; then
echo -e "ALL ALL=(ALL) NOPASSWD: /usr/bin/nmcli, /usr/sbin/reboot\nwww-data ALL=(ALL) NOPASSWD: /usr/bin/git pull\nwww-data ALL=(ALL) NOPASSWD: /usr/bin/ssh\nwww-data ALL=(ALL) NOPASSWD: /usr/bin/python3 *" | sudo tee -a /etc/sudoers > /dev/null
echo -e "ALL ALL=(ALL) NOPASSWD: /usr/bin/nmcli, /usr/sbin/reboot\nwww-data ALL=(ALL) NOPASSWD: /usr/bin/git pull\nwww-data ALL=(ALL) NOPASSWD: /usr/bin/ssh\nwww-data ALL=(ALL) NOPASSWD: /usr/bin/python3 * www-data ALL=(ALL) NOPASSWD: /bin/systemctl *" | sudo tee -a /etc/sudoers > /dev/null
success "Sudo authorization added."
else
warning "Sudo authorization already set. Skipping."