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
|
# Temporarily enable passwordless sudo
|
||||||
# ─────────────────────────────────────
|
# ─────────────────────────────────────
|
||||||
|
|
||||||
SUDOERS_FILE="/etc/sudoers.d/00_$USERNAME"
|
SUDOERS_FILE="/etc/sudoers.d/00_$USERNAME"
|
||||||
|
|
||||||
printf '%s ALL=(ALL:ALL) NOPASSWD: ALL\n' "$USERNAME" > "$SUDOERS_FILE"
|
printf '%s ALL=(ALL:ALL) NOPASSWD: ALL\n' "$USERNAME" > "$SUDOERS_FILE"
|
||||||
chmod 440 "$SUDOERS_FILE"
|
chmod 440 "$SUDOERS_FILE"
|
||||||
|
|
||||||
visudo -c || exit 1
|
visudo -c || exit 1
|
||||||
|
|
||||||
# ─────────────────────────────────────
|
# ─────────────────────────────────────
|
||||||
|
|
@ -191,10 +189,10 @@ cd "$OLDPWD" && rm -rf grub2
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
# Restore password requirement after successful installation
|
# Restore password requirement after successful installation
|
||||||
printf '%s ALL=(ALL) ALL\n' "$USERNAME" > "$SUDOERS_FILE"
|
rm -f "$SUDOERS_FILE"
|
||||||
chmod 440 "$SUDOERS_FILE"
|
|
||||||
visudo -c
|
visudo -c
|
||||||
|
|
||||||
|
# Remove the script from root folder after successfull installation
|
||||||
rm -f after.sh
|
rm -f after.sh
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
Loading…
Reference in a new issue