rootzoll
6 years ago
1 changed files with 6 additions and 5 deletions
@ -1,15 +1,16 @@ |
|||||
#!/bin/bash |
#!/bin/bash |
||||
# RaspiBolt LND Mainnet: script to get public ip address |
|
||||
# /usr/local/bin/getpublicip.sh |
|
||||
|
|
||||
echo 'getpublicip.sh started, writing public IP address every 10 minutes into /run/publicip' |
echo 'getpublicip.sh started, writing public IP address every 10 minutes into /run/publicip' |
||||
while [ 0 ]; |
while [ 0 ]; |
||||
do |
do |
||||
# when TOR is installed the fixed onion address is already in /run/publicip |
# check if TOR is running |
||||
torExists=$(sudo ls /mnt/hdd/tor/web80/hostname 2>/dev/null | grep hostname -c) |
torExists=$(sudo ls /mnt/hdd/tor/lnd9735/hostname 2>/dev/null | grep hostname -c) |
||||
if [ ${torExists} -eq 0 ]; then |
if [ ${torExists} -eq 0 ]; then |
||||
# get public IP |
# get and set public IP |
||||
printf "PUBLICIP=$(curl -vv ipinfo.io/ip 2> /run/publicip.log)\n" > /run/publicip; |
printf "PUBLICIP=$(curl -vv ipinfo.io/ip 2> /run/publicip.log)\n" > /run/publicip; |
||||
|
else |
||||
|
# set onion address |
||||
|
printf "PUBLICIP=$(sudo cat /mnt/hdd/tor/lnd9735/hostname)\n" > /run/publicip; |
||||
fi |
fi |
||||
sleep 600 |
sleep 600 |
||||
done; |
done; |
Loading…
Reference in new issue