mirror of
https://github.com/linuxserver/docker-openssh-server.git
synced 2026-02-20 04:33:38 +08:00
Socat added
This commit is contained in:
parent
46617e04b8
commit
45f0e0230a
@ -15,6 +15,7 @@ RUN \
|
||||
logrotate \
|
||||
nano \
|
||||
netcat-openbsd \
|
||||
socat \
|
||||
sudo && \
|
||||
echo "**** install openssh-server ****" && \
|
||||
if [ -z ${OPENSSH_RELEASE+x} ]; then \
|
||||
|
||||
18
root/etc/s6-overlay/s6-rc.d/svc-socat/run
Executable file
18
root/etc/s6-overlay/s6-rc.d/svc-socat/run
Executable file
@ -0,0 +1,18 @@
|
||||
#!/usr/bin/with-contenv bash
|
||||
# shellcheck shell=bash
|
||||
|
||||
SOCAT_ENABLED=${SOCAT_ENABLED:-false}
|
||||
SOCAT_LISTEN_PORT=${SOCAT_LISTEN_PORT:-43388}
|
||||
SOCAT_TARGET_HOST=${SOCAT_TARGET_HOST:-localhost}
|
||||
SOCAT_TARGET_PORT=${SOCAT_TARGET_PORT:-43389}
|
||||
SOCAT_Log_Level=${SOCAT_LOG_LEVEL:--ddd}
|
||||
|
||||
if [[ "${SOCAT_ENABLED}" != "true" ]]; then
|
||||
echo "Socat service disabled. Set SOCAT_ENABLED=true to enable."
|
||||
exec sleep infinity
|
||||
fi
|
||||
|
||||
echo "Starting socat forwarding: LISTEN:${SOCAT_LISTEN_PORT} -> ${SOCAT_TARGET_HOST}:${SOCAT_TARGET_PORT}"
|
||||
exec /usr/bin/socat ${SOCAT_Log_Level} \
|
||||
TCP-LISTEN:${SOCAT_LISTEN_PORT},fork,reuseaddr \
|
||||
TCP4:${SOCAT_TARGET_HOST}:${SOCAT_TARGET_PORT}
|
||||
1
root/etc/s6-overlay/s6-rc.d/svc-socat/type
Normal file
1
root/etc/s6-overlay/s6-rc.d/svc-socat/type
Normal file
@ -0,0 +1 @@
|
||||
longrun
|
||||
Loading…
x
Reference in New Issue
Block a user