Update after.sh

This commit is contained in:
Baltrust 2026-10-14 16:59:31 +03:00
parent aea3d35b86
commit 0abf7981fc

View file

@ -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