From 5d706308b5fb853b44d5a0c38d24db369adf8746 Mon Sep 17 00:00:00 2001 From: rootzoll Date: Fri, 24 Aug 2018 14:07:31 +0200 Subject: [PATCH] fix public for tor --- home.admin/assets/getpublicip.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/home.admin/assets/getpublicip.sh b/home.admin/assets/getpublicip.sh index 7e388afd5..bfd0342dc 100644 --- a/home.admin/assets/getpublicip.sh +++ b/home.admin/assets/getpublicip.sh @@ -1,15 +1,16 @@ #!/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' while [ 0 ]; do - # when TOR is installed the fixed onion address is already in /run/publicip - torExists=$(sudo ls /mnt/hdd/tor/web80/hostname 2>/dev/null | grep hostname -c) + # check if TOR is running + torExists=$(sudo ls /mnt/hdd/tor/lnd9735/hostname 2>/dev/null | grep hostname -c) 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; + else + # set onion address + printf "PUBLICIP=$(sudo cat /mnt/hdd/tor/lnd9735/hostname)\n" > /run/publicip; fi sleep 600 done; \ No newline at end of file