You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
431 B
Bash
20 lines
431 B
Bash
#!/bin/bash
|
|
set -e
|
|
|
|
if [ "$1" = 'bitcoin-cli' -o "$1" = 'bitcoin-tx' -o "$1" = 'bitcoind' -o "$1" = 'test_bitcoin' ]; then
|
|
mkdir -p "$BITCOIN_DATA"
|
|
|
|
if [ ! -s "$BITCOIN_DATA/bitcoin.conf" ]; then
|
|
cat <<-EOF > "$BITCOIN_DATA/bitcoin.conf"
|
|
printtoconsole=1
|
|
rpcpassword=${BITCOIN_RPC_PASSWORD:-password}
|
|
rpcuser=${BITCOIN_RPC_USER:-bitcoin}
|
|
EOF
|
|
fi
|
|
|
|
chown -R bitcoin "$BITCOIN_DATA"
|
|
exec gosu bitcoin "$@"
|
|
fi
|
|
|
|
exec "$@"
|