rootzoll
6 years ago
11 changed files with 14 additions and 62 deletions
@ -1,21 +0,0 @@ |
|||
# RaspiBolt LND Mainnet: systemd unit for getpublicip.sh script |
|||
# /etc/systemd/system/getpublicip.service |
|||
|
|||
[Unit] |
|||
Description=getpublicip.sh: get public ip address from ipinfo.io |
|||
Wants=bootstrap.service |
|||
After=bootstrap.service |
|||
|
|||
[Service] |
|||
User=root |
|||
Group=root |
|||
Type=simple |
|||
ExecStart=/usr/local/bin/getpublicip.sh |
|||
ExecStartPost=/bin/sleep 5 |
|||
Restart=always |
|||
|
|||
RestartSec=600 |
|||
TimeoutSec=10 |
|||
|
|||
[Install] |
|||
WantedBy=multi-user.target |
@ -1,16 +0,0 @@ |
|||
#!/bin/bash |
|||
|
|||
echo 'getpublicip.sh started, writing public IP address every 10 minutes into /run/publicip' |
|||
while [ 0 ]; |
|||
do |
|||
# 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 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; |
Loading…
Reference in new issue