diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index a56d8b8..95e1fad 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -41,7 +41,11 @@ if [[ $DOCKER_HOST = unix://* ]]; then Typically you should run your nginxproxy/nginx-proxy with: \`-v /var/run/docker.sock:$socket_file:ro\` See the documentation at http://git.io/vZaGJ EOT - socketMissing=1 + + # If the user has run the default command and the socket doesn't exist, fail + if [ "$1" = forego ] && [ "$2" = start ] && [ "$3" = '-r' ]; then + exit 1 + fi fi fi @@ -61,9 +65,4 @@ elif [[ $RESOLVERS =~ $SCOPED_IPV6_REGEX ]]; then RESOLVERS=$(echo "$RESOLVERS" | sed -r "s/$SCOPED_IPV6_REGEX//g" | xargs echo -n); export RESOLVERS fi -# If the user has run the default command and the socket doesn't exist, fail -if [ "$socketMissing" = 1 ] && [ "$1" = forego ] && [ "$2" = start ] && [ "$3" = '-r' ]; then - exit 1 -fi - exec "$@"