Update install.func

This commit is contained in:
CanbiZ 2025-11-24 10:28:56 +01:00
parent 532fa094f3
commit 3a4d938fac

View File

@ -270,14 +270,15 @@ motd_ssh() {
# - Sets proper permissions on SSH directories and key files # - Sets proper permissions on SSH directories and key files
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
customize() { customize() {
if [[ "$PASSWORD" == "" ]]; then if [[ -z "${PASSWORD:-}" ]]; then
msg_info "Customizing Container" msg_info "Configuring autologin for root"
passwd -d root >/dev/null 2>&1 || true
GETTY_OVERRIDE="/etc/systemd/system/container-getty@1.service.d/override.conf" GETTY_OVERRIDE="/etc/systemd/system/container-getty@1.service.d/override.conf"
mkdir -p $(dirname $GETTY_OVERRIDE) mkdir -p "$(dirname "$GETTY_OVERRIDE")"
cat <<EOF >$GETTY_OVERRIDE cat <<EOF >"$GETTY_OVERRIDE"
[Service] [Service]
ExecStart= ExecStart=
ExecStart=-/sbin/agetty --autologin root --noclear --keep-baud tty%I 115200,38400,9600 \$TERM ExecStart=-/sbin/agetty --autologin root --noclear --keep-baud tty%I 115200,38400,9600 \$TERM
EOF EOF
$STD systemctl daemon-reload || true $STD systemctl daemon-reload || true
msg_ok "Customized Container" msg_ok "Customized Container"