From 723b7b1284f015905632c24eb3c9e5f9bcc107fd Mon Sep 17 00:00:00 2001 From: Mathieu Broillet Date: Fri, 30 Aug 2024 11:19:48 +0200 Subject: [PATCH] improve to use less sudo commands --- .github/wiki/script-auto-config-linux.sh | 22 +++++++++---------- README.md | 15 +++++++++++-- .../easy_computer_manager/const.py | 10 ++++----- 3 files changed, 29 insertions(+), 18 deletions(-) diff --git a/.github/wiki/script-auto-config-linux.sh b/.github/wiki/script-auto-config-linux.sh index c997604..3d19622 100644 --- a/.github/wiki/script-auto-config-linux.sh +++ b/.github/wiki/script-auto-config-linux.sh @@ -32,7 +32,7 @@ fi # Configure sudoers print_colored "$COLOR_BLUE" "Configuring sudoers..." echo -e "\n# Allow your user to execute specific commands without a password (for EasyComputerManager/HA)" | sudo tee -a /etc/sudoers > /dev/null -echo "$USER_BEHIND_SUDO ALL=(ALL) NOPASSWD: /sbin/shutdown, /sbin/init, /usr/bin/systemctl, /usr/sbin/pm-suspend, /usr/bin/awk, /usr/sbin/grub-reboot, /usr/sbin/grub2-reboot" | sudo tee -a /etc/sudoers > /dev/null +echo "$USER_BEHIND_SUDO ALL=(ALL) NOPASSWD: /sbin/shutdown, /sbin/init, /usr/sbin/pm-suspend, /usr/sbin/grub-reboot, /usr/sbin/grub2-reboot, /usr/bin/cat /etc/grub2.cfg, /usr/bin/cat /etc/grub.cfg" | sudo tee -a /etc/sudoers > /dev/null print_colored "$COLOR_GREEN" "Sudoers file configured successfully." # Firewall Configuration @@ -51,16 +51,16 @@ DESKTOP_ENTRY_NAME="EasyComputerManager-AutoStart" DESKTOP_ENTRY_PATH="/home/$USER_BEHIND_SUDO/.config/autostart/$DESKTOP_ENTRY_NAME.desktop" # Create the desktop entry file for the Desktop Environment to autostart at login every reboot -# cat > "$DESKTOP_ENTRY_PATH" <