Another attempt

master
Meliurwen 4 years ago
parent bf77fbbd99
commit 7c9679e7ac
Signed by: meliurwen
GPG Key ID: 818A8B35E9F1CE10
  1. 13
      root/entrypoint.sh

@ -1,11 +1,6 @@
#!/bin/bash #!/bin/bash
set -Eeo pipefail set -Eeo pipefail
if [ ! -e /etc/openvpn/sshd_config ]; then
echo "Configuration file sshd_config not found. Initializing..."
cp /config/sshd_config /etc/ssh/sshd_config
fi
# shellcheck disable=2154 # shellcheck disable=2154
trap 's=$?; echo "$0: Error on line "$LINENO": $BASH_COMMAND"; exit $s' ERR trap 's=$?; echo "$0: Error on line "$LINENO": $BASH_COMMAND"; exit $s' ERR
@ -20,6 +15,14 @@ function log() {
echo "[$0] $*" >&2 echo "[$0] $*" >&2
} }
# Check that `sshd_config` exists
# In case `/etc/ssh/` is mounted as a volume the file `sshd_config` is not
# guaranteed to be there
if [ ! -e /etc/ssh/sshd_config ]; then
echo "Configuration file sshd_config not found. Initializing..."
cp /config/sshd_config /etc/ssh/sshd_config
fi
# Allow running other programs, e.g. bash # Allow running other programs, e.g. bash
if [[ -z "$1" || "$1" =~ $reArgsMaybe ]]; then if [[ -z "$1" || "$1" =~ $reArgsMaybe ]]; then
startSshd=true startSshd=true

Loading…
Cancel
Save