Changeset View
Changeset View
Standalone View
Standalone View
contrib/seeds/test-seeds.sh
Show All 19 Lines | help_message() { | ||||
echo "" | echo "" | ||||
echo "Options:" | echo "Options:" | ||||
echo "-t, --testnet Connect to testnet seeds (mainnet is default)." | echo "-t, --testnet Connect to testnet seeds (mainnet is default)." | ||||
echo "-h, --help Display this help message." | echo "-h, --help Display this help message." | ||||
echo "" | echo "" | ||||
echo "Environment Variables:" | echo "Environment Variables:" | ||||
echo "BUILD_DIR Default: ${DEFAULT_BUILD_DIR}" | echo "BUILD_DIR Default: ${DEFAULT_BUILD_DIR}" | ||||
echo "RPC_PORT Default: ${DEFAULT_RPC_PORT}" | echo "RPC_PORT Default: ${DEFAULT_RPC_PORT}" | ||||
exit 0 | |||||
} | } | ||||
: "${BUILD_DIR:=${DEFAULT_BUILD_DIR}}" | : "${BUILD_DIR:=${DEFAULT_BUILD_DIR}}" | ||||
OPTION_TESTNET="" | OPTION_TESTNET="" | ||||
# Parse command line arguments | # Parse command line arguments | ||||
while [[ $# -gt 0 ]]; do | while [[ $# -gt 0 ]]; do | ||||
case $1 in | case $1 in | ||||
-t|--testnet) | -t|--testnet) | ||||
OPTION_TESTNET="--testnet" | OPTION_TESTNET="--testnet" | ||||
shift # shift past argument | shift # shift past argument | ||||
;; | ;; | ||||
-h|--help) | -h|--help) | ||||
help_message | help_message | ||||
shift # shift past argument | exit 0 | ||||
;; | ;; | ||||
*) | *) | ||||
echo "Unknown argument: $1" | echo "Unknown argument: $1" | ||||
help_message | help_message | ||||
shift # shift past argument | exit 1 | ||||
;; | ;; | ||||
esac | esac | ||||
done | done | ||||
BITCOIND="${BUILD_DIR}/src/bitcoind" | BITCOIND="${BUILD_DIR}/src/bitcoind" | ||||
BITCOIN_CLI="${BUILD_DIR}/src/bitcoin-cli" | BITCOIN_CLI="${BUILD_DIR}/src/bitcoin-cli" | ||||
if [ ! -x "${BITCOIND}" ]; then | if [ ! -x "${BITCOIND}" ]; then | ||||
echo "${BITCOIND} does not exist or has incorrect permissions." | echo "${BITCOIND} does not exist or has incorrect permissions." | ||||
▲ Show 20 Lines • Show All 77 Lines • Show Last 20 Lines |