Skip to content
This repository has been archived by the owner on Mar 19, 2024. It is now read-only.

Commit

Permalink
Add RPC User to bitcoin
Browse files Browse the repository at this point in the history
  • Loading branch information
nolim1t committed Mar 3, 2020
1 parent 9097889 commit 1be9fb3
Showing 1 changed file with 26 additions and 9 deletions.
35 changes: 26 additions & 9 deletions stage2/01-sys-tweaks/files/rc.local
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 1be9fb3

Please sign in to comment.