diff --git a/after.sh b/after.sh index 6cde001..2b9d00f 100644 --- a/after.sh +++ b/after.sh @@ -14,12 +14,10 @@ USER_HOME="/home/$USERNAME" # ───────────────────────────────────── # Temporarily enable passwordless sudo # ───────────────────────────────────── - SUDOERS_FILE="/etc/sudoers.d/00_$USERNAME" printf '%s ALL=(ALL:ALL) NOPASSWD: ALL\n' "$USERNAME" > "$SUDOERS_FILE" chmod 440 "$SUDOERS_FILE" - visudo -c || exit 1 # ───────────────────────────────────── @@ -191,10 +189,10 @@ cd "$OLDPWD" && rm -rf grub2 EOF # Restore password requirement after successful installation -printf '%s ALL=(ALL) ALL\n' "$USERNAME" > "$SUDOERS_FILE" -chmod 440 "$SUDOERS_FILE" +rm -f "$SUDOERS_FILE" visudo -c +# Remove the script from root folder after successfull installation rm -f after.sh exit 0 \ No newline at end of file