mirror of
https://github.com/rootzoll/raspiblitz.git
synced 2025-02-25 07:07:46 +01:00
refresh TLS seperate
This commit is contained in:
parent
289451a3b8
commit
176bf5d160
3 changed files with 33 additions and 21 deletions
|
@ -110,27 +110,8 @@ if [ "$1" = "0" ] || [ "$1" = "off" ]; then
|
||||||
echo "DynamicDNS is now OFF"
|
echo "DynamicDNS is now OFF"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "deleting TLSCert"
|
# refresh TLS cert
|
||||||
sudo rm /mnt/hdd/lnd/tls.* 2>/dev/null
|
sudo /home/admin/config.scripts/lnd.newtlscert.sh
|
||||||
echo "let lnd generate new TLSCert"
|
|
||||||
sudo -u bitcoin /usr/local/bin/lnd &>/dev/null &
|
|
||||||
echo "wait until generated"
|
|
||||||
newCertExists=0
|
|
||||||
count=0
|
|
||||||
while [ ${newCertExists} -eq 0 ]
|
|
||||||
do
|
|
||||||
count=$(($count + 1))
|
|
||||||
echo "(${count}/60) check for cert"
|
|
||||||
if [ ${count} -gt 60 ]; then
|
|
||||||
echo "FAIL - was not able to generate new LND certs"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
newCertExists=$(sudo ls /mnt/hdd/lnd/tls.cert 2>/dev/null | grep -c '.cert')
|
|
||||||
sleep 2
|
|
||||||
done
|
|
||||||
sudo killall /usr/local/bin/lnd
|
|
||||||
echo "copy new cert to admin user"
|
|
||||||
sudo cp /mnt/hdd/lnd/tls.cert /home/admin/.lnd
|
|
||||||
|
|
||||||
echo "may needs reboot to run normal again"
|
echo "may needs reboot to run normal again"
|
||||||
exit 0
|
exit 0
|
|
@ -70,6 +70,8 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then
|
||||||
# add REST config to lnd.conf (for old configs)
|
# add REST config to lnd.conf (for old configs)
|
||||||
sudo sh -c "echo \"restlisten=0.0.0.0:8080\" >> /mnt/hdd/lnd/lnd.conf"
|
sudo sh -c "echo \"restlisten=0.0.0.0:8080\" >> /mnt/hdd/lnd/lnd.conf"
|
||||||
echo "LND REST config added -> restlisten=0.0.0.0:8080'"
|
echo "LND REST config added -> restlisten=0.0.0.0:8080'"
|
||||||
|
# refresh TLS cert
|
||||||
|
sudo /home/admin/config.scripts/lnd.newtlscert.sh
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo "LND REST config OK -> restlisten=0.0.0.0:8080'"
|
echo "LND REST config OK -> restlisten=0.0.0.0:8080'"
|
||||||
|
|
29
home.admin/config.scripts/lnd.newtlscert.sh
Normal file
29
home.admin/config.scripts/lnd.newtlscert.sh
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# stop services
|
||||||
|
echo "making sure services are not running"
|
||||||
|
sudo systemctl stop lnd 2>/dev/null
|
||||||
|
|
||||||
|
echo "deleting TLSCert"
|
||||||
|
sudo rm /mnt/hdd/lnd/tls.* 2>/dev/null
|
||||||
|
echo "let lnd generate new TLSCert"
|
||||||
|
sudo -u bitcoin /usr/local/bin/lnd &>/dev/null &
|
||||||
|
echo "wait until generated"
|
||||||
|
newCertExists=0
|
||||||
|
count=0
|
||||||
|
while [ ${newCertExists} -eq 0 ]
|
||||||
|
do
|
||||||
|
count=$(($count + 1))
|
||||||
|
echo "(${count}/60) check for cert"
|
||||||
|
if [ ${count} -gt 60 ]; then
|
||||||
|
echo "FAIL - was not able to generate new LND certs"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
newCertExists=$(sudo ls /mnt/hdd/lnd/tls.cert 2>/dev/null | grep -c '.cert')
|
||||||
|
sleep 2
|
||||||
|
done
|
||||||
|
sudo killall /usr/local/bin/lnd
|
||||||
|
echo "copy new cert to admin user"
|
||||||
|
sudo cp /mnt/hdd/lnd/tls.cert /home/admin/.lnd
|
||||||
|
echo "OK TLS certs are fresh"
|
Loading…
Add table
Reference in a new issue