Browse Source

Add RPC User to bitcoin

master
nolim1t 5 years ago
parent
commit
1be9fb386c
No known key found for this signature in database GPG Key ID: F6287B82CC84BCBD
  1. 35
      stage2/01-sys-tweaks/files/rc.local

35
stage2/01-sys-tweaks/files/rc.local

@ -17,23 +17,40 @@ if [ "$_IP" ]; then
printf "My IP address is %s\n" "$_IP"
fi
# Check for statuses directory
if [ ! -d /home/umbrel/statuses ]; then
mkdir -p /home/umbrel/statuses
chown umbrel.umbrel /home/umbrel/statuses
fi
# Check for disk partition status
if [ ! -f /home/umbrel/statuses/disk-partitioned ]; then
echo "Placeholder for disk partitioning tool"
# Do partitioning at first boot
fi
if [ ! -f /home/umbrel/statuses/service-configured ]; then
echo "Enabling defaults for umbrelbox"
update-rc.d umbrelbox defaults || exit 1
echo "Enabling startup for umbrel box"
update-rc.d umbrelbox enable || exit 1
echo "starting up umbrelbox"
/etc/init.d/umbrelbox start
if [ -f /home/umbrel/bin/rpcauth.py ]; then
echo "Running rpcauth.py, and generating secrets for bitcoind"
cd /home/umbrel/bin/
./rpcauth.py lncm | tee /home/umbrel/secrets/generated.txt | head -2 | tail -1 > /home/umbrel/secrets/rpcauth.txt
tail -1 /home/umbrel/secrets/generated.txt > /home/umbrel/secrets/rpcpass.txt
echo "Updating bitcoin.conf"
cat /home/umbrel/secrets/rpcauth.txt >> /home/umbrel/bitcoin/bitcoin.conf
# TODO: Add rpcuser to LND
echo "Enabling defaults for umbrelbox"
update-rc.d umbrelbox defaults || exit 1
echo "Enabling startup for umbrel box"
update-rc.d umbrelbox enable || exit 1
echo "starting up umbrelbox get it started now)"
/etc/init.d/umbrelbox start
# TODO: maybe configure wallet when startup is complete? (or put it inside docker-compose)
# TODO: maybe configure wallet when startup is complete? (or put it inside docker-compose)
# Making this as done so we don't go through updates again
touch /home/umbrel/statuses/service-configured
# Making this as done so we don't go through updates again
touch /home/umbrel/statuses/service-configured
fi
fi
exit 0

Loading…
Cancel
Save