dont overwrite existing config

This commit is contained in:
Jeffrey Paul 2019-09-18 14:23:32 -07:00
parent 0584911403
commit 9238db0955
1 changed files with 2 additions and 0 deletions

View File

@ -5,10 +5,12 @@ export HOME="/var/lib/bitcoind"
# gen random pw for rpc server
RANDOMPW=$(openssl rand -hex 10)
if [[ ! -e $HOME/bitcoin.conf ]]; then
cat <<EOF > $HOME/bitcoin.conf
rpcuser=${BITCOIND_RPCUSER:-rpcuser}
rpcpassword=${BITCOIND_RPCPASSWORD:-$RANDOMPW}
EOF
fi
# SECURITY this puts the rpc password into the container log
cat $HOME/bitcoin.conf