Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion ssh/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ FROM ${BUILD_FROM}
SHELL ["/bin/bash", "-o", "pipefail", "-c"]

# Add env
ENV TERM="xterm-256color"
ENV \
TERM="xterm-256color" \
S6_STAGE2_HOOK=/etc/s6-overlay/scripts/enable-check.sh

# Copy Python requirements file
COPY requirements.txt /tmp/
Expand Down
5 changes: 0 additions & 5 deletions ssh/rootfs/etc/s6-overlay/s6-rc.d/sshd/run
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@
# ==============================================================================
declare -a options

# If SSH is disabled, use a fake sleep process
if ! bashio::var.has_value "$(bashio::addon.port 22)"; then
exec sleep 864000
fi

bashio::log.info 'Starting the SSH daemon...'

# Default options
Expand Down
13 changes: 13 additions & 0 deletions ssh/rootfs/etc/s6-overlay/scripts/enable-check.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/command/with-contenv bashio
# shellcheck shell=bash
# ==============================================================================
# Enable optional services based on the add-on configuration
# ==============================================================================

# Disable the SSH daemon when no SSH port is exposed
if ! bashio::var.has_value "$(bashio::addon.port 22)"; then
bashio::log.info \
"No network port is defined in the configuration so access" \
"will only be available via the web interface."
rm -f /etc/s6-overlay/s6-rc.d/user/contents.d/sshd
fi