Browse Source

moved publicIP to raspiconf file

dev
rootzoll 6 years ago
parent
commit
b50b2cceb3
  1. 38
      home.admin/_bootstrap.sh
  2. 2
      home.admin/assets/lnd.service
  3. 9
      home.admin/assets/lnd.tor.service

38
home.admin/_bootstrap.sh

@ -66,15 +66,6 @@ if [ ${afterSetupScriptExists} -eq 1 ]; then
sleep 100
fi
################################
# PUBLIC IP
# for LND on startup
################################
printf "PUBLICIP=$(curl -vv ipinfo.io/ip 2> /run/publicip.log)\n" > /run/publicip;
chmod 774 /run/publicip
################################
# HDD CHECK & PRE-INIT
################################
@ -221,14 +212,37 @@ if [ ${hddIsAutoMounted} -eq 0 ]; then
sudo umount -l /mnt/hdd
exit 0
fi # END - no automount
#####################################
# UPDATE HDD CONFIG FILE (if exists)
#####################################
echo "Check if HDD contains configuration .." >> $logFile
configExists=$(ls ${configFile} | grep -c '.conf')
if [ ${configExists} -eq 1 ]; then
# load values
echo "load and update publicIP" >> $logFile
source ${configFile}
# update public IP on boot
freshPublicIP=$(curl -vv ipinfo.io/ip 2>/dev/null)
if [ ${#publicIP} -eq 0 ]; then
echo "create value (${freshPublicIP})" >> $logFile
echo "publicIP=${freshPublicIP}" >> $configFile
else
echo "update value (${freshPublicIP})" >> $logFile
sed -i "s/^publicIP=.*/publicIP=${freshPublicIP}/g" ${configFile}
fi
fi
################################
# INFOFILE BASICS
# SD INFOFILE BASICS
################################
# EXIT on BOOTSTRAP HERE AT THE MOMENT
echo "DONE BOOTSTRAP (before any configs etc)" >> $logFile
sed -i "s/^state=.*/state=ready/g" ${infoFile}
sed -i "s/^message=.*/message='waiting login'/g" ${infoFile}
echo "DONE BOOTSTRAP" >> $logFile
exit 0

2
home.admin/assets/lnd.service

@ -9,7 +9,7 @@ After=bitcoind.service
#OnFailure=systemd-sendmail@%n
[Service]
EnvironmentFile=/run/publicip
EnvironmentFile=/mnt/hdd/raspiblitz.conf
ExecStart=/usr/local/bin/lnd --externalip=${PUBLICIP}
PIDFile=/home/bitcoin/.lnd/lnd.pid
User=bitcoin

9
home.admin/assets/lnd.tor.service

@ -9,15 +9,8 @@ After=bitcoind.service
#OnFailure=systemd-sendmail@%n
[Service]
# get var PUBIP from file
EnvironmentFile=/mnt/hdd/tor/v3Address
# TOR Hidden Service v2
EnvironmentFile=/mnt/hdd/raspiblitz.conf
ExecStart=/usr/local/bin/lnd --tor.active --tor.v2 --listen=127.0.0.1:9735
# TOR Hidden Service v3
# ExecStart=/usr/local/bin/lnd --tor.active --tor.v3 --externalip=${V3ADDRESS} --listen=127.0.0.1:9735
PIDFile=/home/bitcoin/.lnd/lnd.pid
User=bitcoin
Group=bitcoin

Loading…
Cancel
Save