2019-08-20 01:36:58 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
source /usr/share/mynode/mynode_config.sh
|
|
|
|
|
|
|
|
set -x
|
|
|
|
|
2021-03-10 06:08:53 +00:00
|
|
|
WALLET_FOLDER="/mnt/hdd/mynode/bitcoin/wallets"
|
|
|
|
if [ -f $IS_TESTNET_ENABLED_FILE ]; then
|
|
|
|
WALLET_FOLDER="/mnt/hdd/mynode/bitcoin/wallets"
|
|
|
|
fi
|
|
|
|
|
2019-08-20 01:36:58 +00:00
|
|
|
sleep 60s
|
|
|
|
|
|
|
|
# Give admin the ability to access the BTC cookie
|
2021-03-31 03:09:55 +00:00
|
|
|
chmod 640 /mnt/hdd/mynode/bitcoin/.cookie
|
2021-04-23 02:43:16 +00:00
|
|
|
cp -f /mnt/hdd/mynode/bitcoin/.cookie /home/admin/.bitcoin/.cookie
|
|
|
|
chown admin:admin /home/admin/.bitcoin/.cookie
|
2019-08-20 01:36:58 +00:00
|
|
|
|
2021-03-09 04:37:46 +00:00
|
|
|
if [ -f /mnt/hdd/mynode/bitcoin/testnet3/.cookie ]; then
|
|
|
|
mkdir -p /mnt/hdd/mynode/bitcoin/testnet3
|
|
|
|
cp -f /mnt/hdd/mynode/bitcoin/testnet3/.cookie /home/admin/.bitcoin/testnet3/.cookie
|
|
|
|
chown -R admin:admin /home/admin/.bitcoin/testnet3
|
|
|
|
fi
|
|
|
|
|
2021-04-11 17:23:50 +00:00
|
|
|
# Make data folders readable for easier transfer between nodes (new files are still 700)
|
|
|
|
#chmod -R 755 /mnt/hdd/mynode/bitcoin/blocks || true
|
|
|
|
#chmod -R 755 /mnt/hdd/mynode/bitcoin/chainstate || true
|
|
|
|
#chmod -R 755 /mnt/hdd/mynode/bitcoin/indexes || true
|
2021-04-11 00:51:26 +00:00
|
|
|
|
2021-02-18 03:22:05 +00:00
|
|
|
# Make default wallets
|
2021-03-10 06:08:53 +00:00
|
|
|
if [ ! -d ${WALLET_FOLDER}/joinmarket_wallet.dat ]; then
|
|
|
|
bitcoin-cli createwallet joinmarket_wallet.dat > /dev/null 2>&1 || true
|
|
|
|
fi
|
2021-02-18 03:22:05 +00:00
|
|
|
bitcoin-cli loadwallet joinmarket_wallet.dat > /dev/null 2>&1 || true
|
|
|
|
|
2019-08-20 01:36:58 +00:00
|
|
|
# Sync FS
|
|
|
|
sync
|