diff --git a/after.sh b/after.sh index 14d0c46..fccbd95 100644 --- a/after.sh +++ b/after.sh @@ -18,10 +18,7 @@ USER_HOME="/home/$USERNAME" # Temporarily enable passwordless sudo # ───────────────────────────────────── -SUDOERS_FILE="/etc/sudoers.d/00_$USERNAME" -SUDOERS_BACKUP="${SUDOERS_FILE}.backup" - -cp "$SUDOERS_FILE" "$SUDOERS_BACKUP" +SUDOERS_FILE="/etc/sudoers.d/99-install-script" printf '%s ALL=(ALL:ALL) NOPASSWD: ALL\n' "$USERNAME" > "$SUDOERS_FILE" chmod 440 "$SUDOERS_FILE" @@ -29,8 +26,7 @@ chmod 440 "$SUDOERS_FILE" visudo -c || exit 1 cleanup() { - mv "$SUDOERS_BACKUP" "$SUDOERS_FILE" - rm -f /etc/sudoers.d/99-install-script + rm -f "$SUDOERS_FILE" visudo -c } trap cleanup EXIT