mynode/rootfs/standard/usr/bin/mynode_chpasswd.sh

19 lines
605 B
Bash
Raw Normal View History

2019-06-15 23:02:44 +00:00
#!/bin/bash
PASSWORD=$1
HASH=$(echo -n "$PASSWORD" | sha256sum | awk '{print $1}')
# Change Linux Password
echo "admin:$PASSWORD" | chpasswd
2019-07-28 23:34:08 +00:00
# Save hashed password
echo "$HASH" > /home/bitcoin/.mynode/.hashedpw
2019-06-15 23:02:44 +00:00
# Change RTL password
sed -i "s/rtlPassHashed=.*/rtlPassHashed=$HASH/g" /opt/mynode/RTL/RTL.conf
2019-11-25 03:45:24 +00:00
systemctl restart rtl &
# Change LND Admin Password
2019-11-09 16:14:56 +00:00
#cp -f /usr/share/mynode/lnd_admin_credentials.json /home/bitcoin/.lnd-admin/credentials.json
#sed -i "s/\"adminPasswordSha256\":.*/\"adminPasswordSha256\": \"$HASH\"/g" /home/bitcoin/.lnd-admin/credentials.json
#systemctl restart lnd_admin