use return instead of exit
This commit is contained in:
@@ -2,24 +2,27 @@
|
|||||||
|
|
||||||
if [[ $EUID -ne 0 ]]; then
|
if [[ $EUID -ne 0 ]]; then
|
||||||
echo "This script must be run as root"
|
echo "This script must be run as root"
|
||||||
exit 1
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ ! -d "Production-NoReverseProxy" ]]; then
|
if [[ ! -d "Production-NoReverseProxy" ]]; then
|
||||||
echo "You must run this script from inside the btcpayserver-docker folder"
|
echo "You must run this script from inside the btcpayserver-docker folder"
|
||||||
exit 1
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! git -C . rev-parse; then
|
if ! git -C . rev-parse; then
|
||||||
echo "You must run this script inside the git repository of btcpayserver-docker"
|
echo "You must run this script inside the git repository of btcpayserver-docker"
|
||||||
exit 1
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
function display_help () {
|
function display_help () {
|
||||||
cat <<-END
|
cat <<-END
|
||||||
Usage:
|
Usage:
|
||||||
------
|
------
|
||||||
This script must be run as root
|
|
||||||
|
Install BTCPay on this server
|
||||||
|
This script must be run as root
|
||||||
|
|
||||||
-i : Run install
|
-i : Run install
|
||||||
|
|
||||||
This script will:
|
This script will:
|
||||||
@@ -53,7 +56,7 @@ END
|
|||||||
|
|
||||||
if [ "$1" != "-i" ]; then
|
if [ "$1" != "-i" ]; then
|
||||||
display_help
|
display_help
|
||||||
exit 1
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
: "${LETSENCRYPT_EMAIL:=me@example.com}"
|
: "${LETSENCRYPT_EMAIL:=me@example.com}"
|
||||||
@@ -97,12 +100,12 @@ BTCPAY_ENV_FILE=$BTCPAY_ENV_FILE
|
|||||||
|
|
||||||
if [ -z "$BTCPAY_HOST" ]; then
|
if [ -z "$BTCPAY_HOST" ]; then
|
||||||
echo "BTCPAY_HOST should not be empty"
|
echo "BTCPAY_HOST should not be empty"
|
||||||
exit 1
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "$BTCPAYGEN_CRYPTO1" ]; then
|
if [ -z "$BTCPAYGEN_CRYPTO1" ]; then
|
||||||
echo "BTCPAYGEN_CRYPTO1 should not be empty"
|
echo "BTCPAYGEN_CRYPTO1 should not be empty"
|
||||||
exit 1
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$NBITCOIN_NETWORK" != "mainnet" ] && [ "$NBITCOIN_NETWORK" != "testnet" ] && [ "$NBITCOIN_NETWORK" != "regtest" ]; then
|
if [ "$NBITCOIN_NETWORK" != "mainnet" ] && [ "$NBITCOIN_NETWORK" != "testnet" ] && [ "$NBITCOIN_NETWORK" != "regtest" ]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user