This commit is contained in:
randogoth 2025-10-18 11:47:07 +03:00
parent 48372efb6d
commit daae8bd74e
9 changed files with 184 additions and 34 deletions

20
scripts/start-services.sh Executable file
View file

@ -0,0 +1,20 @@
#!/bin/bash
set -euo pipefail
TELNET_PORT="${TELNET_PORT:-23}"
TELNET_LOGIN="${TELNET_LOGIN:-/bin/login}"
TELNETD_BIN="${TELNETD_BIN:-/bin/busybox}"
ENABLE_TELNET="${ENABLE_TELNET:-1}"
if [ "$ENABLE_TELNET" = "1" ]; then
if [ ! -x "$TELNETD_BIN" ]; then
echo "Telnet disabled: telnetd binary not found at $TELNETD_BIN" >&2
else
echo "Starting telnetd on port $TELNET_PORT"
if ! "$TELNETD_BIN" telnetd -p "$TELNET_PORT" -l "$TELNET_LOGIN"; then
echo "Warning: failed to launch telnetd; SSH remains available." >&2
fi
fi
fi
exec /usr/sbin/sshd -D -e