Exit if env variables are not set

This commit is contained in:
Adw8 2024-07-17 10:34:19 +05:30
parent 951580888a
commit 133637e044

View File

@ -9,9 +9,20 @@ fi
config_template=$(cat environments/config-template.toml)
local_config="./environments/local.toml"
# Set faucet key from env
# Check if faucet key is set
if [ -z "${CERC_FAUCET_KEY:-}" ]; then
echo "Error: CERC_FAUCET_KEY is not set. Exiting..."
exit 1
fi
faucet_key=${CERC_FAUCET_KEY}
# Check if RPC endpoint is set
if [-z "${CERC_RPC_ENDPOINT:-}" ]; then
echo "Error: CERC_RPC_ENDPOINT is not set. Exiting..."
exit 1
fi
rpc_endpoint=${CERC_RPC_ENDPOINT}
echo "The RPC endpoint is $rpc_endpoint"