Update after.sh
This commit is contained in:
parent
aea3d35b86
commit
0abf7981fc
1 changed files with 2 additions and 4 deletions
6
after.sh
6
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
|
||||
Loading…
Reference in a new issue