Update after.sh
This commit is contained in:
parent
81cf95a239
commit
ad9c6ddc0b
1 changed files with 3 additions and 7 deletions
10
after.sh
10
after.sh
|
|
@ -14,11 +14,8 @@ USER_HOME="/home/$USERNAME"
|
||||||
# ─────────────────────────────────────
|
# ─────────────────────────────────────
|
||||||
# Temporarily enable passwordless sudo
|
# Temporarily enable passwordless sudo
|
||||||
# ─────────────────────────────────────
|
# ─────────────────────────────────────
|
||||||
SUDOERS_FILE="/etc/sudoers.d/00_$USERNAME"
|
install -m 440 /dev/stdin "/etc/sudoers.d/00_$USERNAME" <<< "$USERNAME ALL=(ALL:ALL) NOPASSWD: ALL"
|
||||||
|
visudo -c
|
||||||
printf '%s ALL=(ALL:ALL) NOPASSWD: ALL\n' "$USERNAME" > "$SUDOERS_FILE"
|
|
||||||
chmod 440 "$SUDOERS_FILE"
|
|
||||||
visudo -c || exit 1
|
|
||||||
|
|
||||||
# ─────────────────────────────────────
|
# ─────────────────────────────────────
|
||||||
# Misc
|
# Misc
|
||||||
|
|
@ -189,8 +186,7 @@ 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"
|
install -m 440 /dev/stdin "/etc/sudoers.d/00_$USERNAME" <<< "$USERNAME ALL=(ALL) ALL"
|
||||||
chmod 440 "$SUDOERS_FILE"
|
|
||||||
visudo -c
|
visudo -c
|
||||||
|
|
||||||
# Remove the script from root folder after successfull installation
|
# Remove the script from root folder after successfull installation
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue