Improve RTL password management

This commit is contained in:
Taylor Helsper 2019-07-28 18:34:08 -05:00
parent e6db0ef393
commit 77d87b0989
3 changed files with 15 additions and 0 deletions

View File

@ -6,6 +6,9 @@ HASH=$(echo -n "$PASSWORD" | sha256sum | awk '{print $1}')
# Change Linux Password
echo "admin:$PASSWORD" | chpasswd
# Save hashed password
echo "$HASH" > /home/bitcoin/.mynode/.hashedpw
# Change RTL password
sed -i "s/rtlPassHashed=.*/rtlPassHashed=$HASH/g" /opt/mynode/RTL/RTL.conf
systemctl restart rtl

View File

@ -2,6 +2,14 @@
source /usr/share/mynode/mynode_config.sh
set -x
# Shut down main services to save memory and CPU
systemctl stop bitcoind
systemctl stop lnd
systemctl stop electrs
systemctl stop quicksync
# Install any new software
# apt-get -y install ...

View File

@ -114,6 +114,10 @@ chown bitcoin:bitcoin /mnt/hdd/mynode/lnd/lnd.conf
# RTL config
cp /usr/share/mynode/RTL.conf /opt/mynode/RTL/RTL.conf
if [ -f /home/bitcoin/.mynode/.hashedpw ]; then
HASH=$(cat /home/bitcoin/.mynode/.hashedpw)
sed -i "s/rtlPassHashed=.*/rtlPassHashed=$HASH/g" /opt/mynode/RTL/RTL.conf
fi
chown bitcoin:bitcoin /opt/mynode/RTL/RTL.conf