From 8aacd13241f7bd4e4110bcbf351a0ded422a730a Mon Sep 17 00:00:00 2001 From: polarathene <5098581+polarathene@users.noreply.github.com> Date: Sat, 25 Sep 2021 15:36:07 +1200 Subject: [PATCH] chore: 1/6 - Inline failure at it's cause This change has been split into 6 iterative parts/commits to ease the review process. --- docker-entrypoint.sh | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) 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 "$@"