2020-11-02 04:08:18 +00:00
|
|
|
#!/bin/sh
|
2020-09-17 16:02:24 +00:00
|
|
|
|
2020-11-02 04:08:18 +00:00
|
|
|
DIR=$(readlink -f "$(dirname "$0")")
|
|
|
|
. "$DIR/../env.sh"
|
2020-09-17 16:02:24 +00:00
|
|
|
|
2020-11-02 04:08:18 +00:00
|
|
|
echo 'Please enter autologin username (empty to skip): '
|
|
|
|
read -r username
|
2020-09-17 16:02:24 +00:00
|
|
|
if [ -z "$username" ]; then
|
|
|
|
echo skip autologin setup
|
|
|
|
else
|
|
|
|
sudo mkdir -p /etc/systemd/system/getty@tty1.service.d
|
2020-11-02 04:08:18 +00:00
|
|
|
sed -r "s/USERNAME/$username/g" "$DIR/systemd/getty1-override.conf" | \
|
2020-09-17 16:02:24 +00:00
|
|
|
sudo tee /etc/systemd/system/getty@tty1.service.d/override.conf
|
2020-09-18 04:16:15 +00:00
|
|
|
fi
|