fix for lego/set-e-fix #12
@@ -1,5 +1,5 @@
 | 
				
			|||||||
#!/usr/bin/env bash
 | 
					#!/usr/bin/env bash
 | 
				
			||||||
set -euo pipefail
 | 
					set -xeuo pipefail
 | 
				
			||||||
 | 
					
 | 
				
			||||||
LEGO_BINARY=$(/usr/bin/env which lego)
 | 
					LEGO_BINARY=$(/usr/bin/env which lego)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -8,8 +8,11 @@ if [[ -n "${LEGO_HTTP_FALLBACK_PORT:-}" ]]; then
 | 
				
			|||||||
    echo "nc not found (in PATH), exiting"
 | 
					    echo "nc not found (in PATH), exiting"
 | 
				
			||||||
    exit 1
 | 
					    exit 1
 | 
				
			||||||
  fi
 | 
					  fi
 | 
				
			||||||
 | 
					  set +e
 | 
				
			||||||
  nc -z 127.0.0.1 $LEGO_HTTP_PORT;
 | 
					  nc -z 127.0.0.1 $LEGO_HTTP_PORT;
 | 
				
			||||||
  if [[ $? -eq 0 ]]; then
 | 
					  nc_exit_code=$?;
 | 
				
			||||||
 | 
					  set -e
 | 
				
			||||||
 | 
					  if [[ $nc_exit_code -eq 0 ]]; then
 | 
				
			||||||
      LEGO_HTTP_PORT=$LEGO_HTTP_FALLBACK_PORT
 | 
					      LEGO_HTTP_PORT=$LEGO_HTTP_FALLBACK_PORT
 | 
				
			||||||
  fi
 | 
					  fi
 | 
				
			||||||
fi
 | 
					fi
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user