mirror of
https://github.com/rootzoll/raspiblitz.git
synced 2025-02-24 22:58:43 +01:00
fixing check lnd.conf change
This commit is contained in:
parent
a07273694c
commit
415cadf5b6
3 changed files with 7 additions and 7 deletions
|
@ -161,10 +161,10 @@ if sys.argv[1] == "on":
|
|||
|
||||
# make sure serverdomain is set as tls alias
|
||||
print("Setting server as tls alias")
|
||||
oldConfigHash=subprocess.getoutput("sudo shasum -a 256 /mnt/hdd/lnd/tls.cert")
|
||||
oldConfigHash=subprocess.getoutput("sudo shasum -a 256 /mnt/hdd/lnd/lnd.conf")
|
||||
subprocess.call("sudo sed -i \"s/^#tlsextradomain=.*/tlsextradomain=/g\" /mnt/hdd/lnd/lnd.conf", shell=True)
|
||||
subprocess.call("sudo sed -i \"s/^tlsextradomain=.*/tlsextradomain=%s/g\" /mnt/hdd/lnd/lnd.conf" % (serverdomain), shell=True)
|
||||
newConfigHash=subprocess.getoutput("sudo shasum -a 256 /mnt/hdd/lnd/tls.cert")
|
||||
newConfigHash=subprocess.getoutput("sudo shasum -a 256 /mnt/hdd/lnd/lnd.conf")
|
||||
if oldConfigHash != newConfigHash:
|
||||
print("lnd.conf changed ... generating new TLS cert")
|
||||
subprocess.call("sudo /home/admin/config.scripts/lnd.newtlscert.sh", shell=True)
|
||||
|
|
|
@ -76,7 +76,7 @@ fi
|
|||
if [ "$1" = "1" ] || [ "$1" = "on" ]; then
|
||||
|
||||
# get hash of lnd.conf before edit (to detect if changed later)
|
||||
md5HashBefore=$(sudo shasum -a 256 /mnt/hdd/lnd/tls.cert)
|
||||
md5HashBefore=$(sudo shasum -a 256 /mnt/hdd/lnd/lnd.conf)
|
||||
|
||||
# make sure config values are uncommented
|
||||
sudo sed -i "s/^#restlisten=.*/restlisten=/g" /mnt/hdd/lnd/lnd.conf
|
||||
|
@ -97,7 +97,7 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then
|
|||
sudo sed -i "s/^tlsextraip=.*/tlsextraip=0.0.0.0/g" /mnt/hdd/lnd/lnd.conf
|
||||
|
||||
# refresh TLS cert (if lnd.conf was changed)
|
||||
md5HashAfter=$(sudo shasum -a 256 /mnt/hdd/lnd/tls.cert)
|
||||
md5HashAfter=$(sudo shasum -a 256 /mnt/hdd/lnd/lnd.conf)
|
||||
if [ "${md5HashAfter}" != "${md5HashBefore}" ]; then
|
||||
echo "# lnd.conf changed - TLS certs need refreshing"
|
||||
sudo /home/admin/config.scripts/lnd.newtlscert.sh
|
||||
|
|
|
@ -29,7 +29,7 @@ if [ ${configExists} -eq 0 ]; then
|
|||
fi
|
||||
|
||||
# get hash of lnd.conf before edit (to detect if changed later)
|
||||
md5HashBefore=$(sudo shasum -a 256 /mnt/hdd/lnd/tls.cert)
|
||||
md5HashBefore=$(sudo shasum -a 256 /mnt/hdd/lnd/lnd.conf)
|
||||
|
||||
# FIXED DOMAIN/IP
|
||||
if [ "${mode}" = "on" ]; then
|
||||
|
@ -55,7 +55,7 @@ if [ "${mode}" = "on" ]; then
|
|||
sudo sed -i "s/^tlsextradomain=.*/tlsextradomain=${address}/g" /mnt/hdd/lnd/lnd.conf
|
||||
|
||||
# refresh TLS cert
|
||||
md5HashAfter=$(sudo shasum -a 256 /mnt/hdd/lnd/tls.cert)
|
||||
md5HashAfter=$(sudo shasum -a 256 /mnt/hdd/lnd/lnd.conf)
|
||||
if [ "${md5HashAfter}" != "${md5HashBefore}" ]; then
|
||||
echo "# lnd.conf changed - TLS certs need refreshing"
|
||||
sudo /home/admin/config.scripts/lnd.newtlscert.sh
|
||||
|
@ -83,7 +83,7 @@ if [ "${mode}" = "off" ]; then
|
|||
sudo sed -i "s/^tlsextradomain=.*/#tlsextradomain=/g" /mnt/hdd/lnd/lnd.conf
|
||||
|
||||
# refresh TLS cert
|
||||
md5HashAfter=$(sudo shasum -a 256 /mnt/hdd/lnd/tls.cert)
|
||||
md5HashAfter=$(sudo shasum -a 256 /mnt/hdd/lnd/lnd.conf)
|
||||
if [ "${md5HashAfter}" != "${md5HashBefore}" ]; then
|
||||
echo "# lnd.conf changed - TLS certs need refreshing"
|
||||
sudo /home/admin/config.scripts/lnd.newtlscert.sh
|
||||
|
|
Loading…
Add table
Reference in a new issue