docker-bitcoind/bitcoin.run

29 lines
614 B
Plaintext
Raw Normal View History

2016-04-11 03:38:48 +00:00
#!/bin/bash
export HOME="/var/lib/bitcoin"
# gen random pw for rpc server
DEFAULTPW=$(dd if=/dev/urandom bs=10 count=1 status=none | shasum | cut -b 1-20)
if [ ! -e "$HOME/bitcoin.conf" ]; then
echo "creating bitcoin.conf"
cat <<EOF > $HOME/bitcoin.conf
rpcuser=${BITCOIND_RPC_USER:-rpcuser}
rpcpassword=${BITCOIND_RPC_PASSWORD:-$DEFAULTPW}
EOF
fi
chown -R bitcoin:bitcoin $HOME
exec chpst -ubitcoin \
bitcoind \
-printtoconsole \
-disablewallet \
-datadir $HOME \
-conf $HOME/bitcoin.conf \
-rpcallowip=::/0 \
$BITCOIND_EXTRA_OPTS \
2>&1