config/yadm/bootstrap: do not hardcode agetty

This commit is contained in:
xeruf 2022-03-23 13:49:11 +01:00
parent ae0405554e
commit 76c2388b42
1 changed files with 5 additions and 4 deletions

View File

@ -1,4 +1,3 @@
# Headings
SECTION() { printf "\n$1\n"; }
highlight() { printf "$1\n"; }
subhighlight() { printf "$1\n"; }
@ -19,10 +18,12 @@ echo "$USER ALL = NOPASSWD: /usr/bin/halt, /usr/bin/shutdown, /usr/bin/reboot, /
sudo tee /etc/sudoers.d/shutdown
highlight "Set default user in tty1,2,3"
sudo mkdir -p /etc/systemd/system/getty@tty{1,2,3}.service.d
echo "[Service]
agetty="$(sudo which agetty)" &&
sudo mkdir -p /etc/systemd/system/getty@tty{1,2,3}.service.d &&
echo "[Service]
Restart=Never
ExecStart=
ExecStart=-/usr/bin/agetty --skip-login --login-options $USER %I" |
ExecStart=-$agetty --skip-login --login-options $USER %I" |
sudo tee /etc/systemd/system/getty@tty1.service.d/override.conf /etc/systemd/system/getty@tty2.service.d/override.conf /etc/systemd/system/getty@tty3.service.d/override.conf
highlight "Sysyadm setup"