overwrite conf file every run
This commit is contained in:
parent
c9aecd86c8
commit
63477b2b5f
15
bitcoin.run
15
bitcoin.run
|
@ -3,20 +3,15 @@
|
||||||
export HOME="/var/lib/bitcoin"
|
export HOME="/var/lib/bitcoin"
|
||||||
|
|
||||||
# gen random pw for rpc server
|
# gen random pw for rpc server
|
||||||
DEFAULTPW=$(dd if=/dev/urandom bs=10 count=1 status=none | shasum | cut -b 1-20)
|
RANDOMPW=$(dd if=/dev/urandom bs=10 count=1 status=none | shasum | cut -b 1-20)
|
||||||
|
|
||||||
if [ ! -e "$HOME/bitcoin.conf" ]; then
|
cat <<EOF > $HOME/bitcoin.conf
|
||||||
|
rpcuser=${BITCOIND_RPCUSER:-rpcuser}
|
||||||
echo "creating bitcoin.conf"
|
rpcpassword=${BITCOIND_RPCPASSWORD:-$RANDOMPW}
|
||||||
|
|
||||||
cat <<EOF > $HOME/bitcoin.conf
|
|
||||||
rpcuser=${BITCOIND_RPC_USER:-rpcuser}
|
|
||||||
rpcpassword=${BITCOIND_RPC_PASSWORD:-$DEFAULTPW}
|
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
fi
|
|
||||||
|
|
||||||
chown -R bitcoin:bitcoin $HOME
|
chown -R bitcoin:bitcoin $HOME
|
||||||
|
|
||||||
exec chpst -ubitcoin \
|
exec chpst -ubitcoin \
|
||||||
bitcoind \
|
bitcoind \
|
||||||
-printtoconsole \
|
-printtoconsole \
|
||||||
|
|
Loading…
Reference in New Issue