Update install.func
This commit is contained in:
parent
645b532e17
commit
1f6034a15b
@ -268,19 +268,39 @@ motd_ssh() {
|
||||
customize() {
|
||||
if [[ -z "${PASSWORD:-}" ]]; then
|
||||
msg_info "Configuring autologin for root"
|
||||
|
||||
# Enable root account (remove password lock)
|
||||
passwd -d root >/dev/null 2>&1 || true
|
||||
|
||||
# Create getty override for container-getty@1.service
|
||||
GETTY_OVERRIDE="/etc/systemd/system/container-getty@1.service.d/override.conf"
|
||||
mkdir -p "$(dirname "$GETTY_OVERRIDE")"
|
||||
cat <<EOF >"$GETTY_OVERRIDE"
|
||||
cat <<'EOF' >"$GETTY_OVERRIDE"
|
||||
[Service]
|
||||
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 linux
|
||||
EOF
|
||||
$STD systemctl daemon-reload || true
|
||||
msg_ok "Customized Container"
|
||||
|
||||
# Create getty override for console-getty.service
|
||||
CONSOLE_OVERRIDE="/etc/systemd/system/console-getty.service.d/override.conf"
|
||||
mkdir -p "$(dirname "$CONSOLE_OVERRIDE")"
|
||||
cat <<'EOF' >"$CONSOLE_OVERRIDE"
|
||||
[Service]
|
||||
ExecStart=
|
||||
ExecStart=-/sbin/agetty --autologin root --noclear --keep-baud console 115200,38400,9600 linux
|
||||
EOF
|
||||
|
||||
# Reload systemd daemon
|
||||
$STD systemctl daemon-reload
|
||||
|
||||
msg_ok "Autologin configured"
|
||||
fi
|
||||
|
||||
msg_ok "Customized Container"
|
||||
|
||||
echo "bash -c \"\$(curl -fsSL https://github.com/community-scripts/ProxmoxVED/raw/main/ct/${app}.sh)\"" >/usr/bin/update
|
||||
chmod +x /usr/bin/update
|
||||
|
||||
if [[ -n "${SSH_AUTHORIZED_KEY}" ]]; then
|
||||
mkdir -p /root/.ssh
|
||||
echo "${SSH_AUTHORIZED_KEY}" >/root/.ssh/authorized_keys
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user