ostridge
Guru
- Joined
- Jan 22, 2015
- Messages
- 1,618
- Reaction score
- 517
Hi, I have been playing with ./myip and made a copy to try script an update of my wan-rdns in /etc/hosts
I have noticed that whilst:
the output from ~/myip is showing my wan-ip same as updated by crontab to show ddns-ip from afraid.org.
BUT the actual updated ip is placing the 127.0.0.1 (loopback) with the line
The actual [obfuscated] output with debug on as follows:
So the relevant question is why would we need the loopback address updated; and shouldn't this update the wan-ip as the stdout suggests it has done?
I have noticed that whilst:
the output from ~/myip is showing my wan-ip same as updated by crontab to show ddns-ip from afraid.org.
BUT the actual updated ip is placing the 127.0.0.1 (loopback) with the line
Code:
echo "externip=$externip" > /etc/asterisk/sip_custom.conf
Code:
root@pi2:~# ping my.ddns.tld
PING my.ddns.tld (147.x.xx.xxx) 56(84) bytes of data.
64 bytes from xxx.xx.x.147.svr.provider.tld (147.x.xx.xxx): icmp_req=1 ttl=64 time=0.656 ms
root@pi2:~#
root@pi2:~#
root@pi2:~#
root@pi2:~# ./myip
+ fqdn=pi2.dom.tld
+ localnet=192.168.1.0
++ ping -c 1 pi2.dom.tld
++ cut -f 1 -d ')' -s
++ cut -f 2 -d '('
++ grep -m 1 '^'
+ externip=127.0.0.1
+ '[' -e /tmp/127.0.0.1 ']'
+ echo No IP Update Required
No IP Update Required
+ echo 'my ExternIP:'
my ExternIP:
+ curl -s http://myip.dnsomatic.com/
147.x.xx.xxx+ echo ' '
So the relevant question is why would we need the loopback address updated; and shouldn't this update the wan-ip as the stdout suggests it has done?