Getting the current IP address from the Fonera Box
Submitted by matthias hub on Mon, 09/20/2010 - 23:02
I wrote a little script to get the current public IP address from the Fonera status page. In my set up the box has the default internal IP address 192.168.10.1.
Here the full script:
(As you see I used it to do a dyndns compatible update. On the server backend this just requires a bind configuration and a simple update script. Maybe I will show that later here.)
Here the full script:
#!/bin/sh
IP_ADDRESS=`wget -q -O - http://192.168.10.1/cgi-bin/status.sh | grep "IP Address" | sed -n '//{p;q;}' | sed 's/.* //' | sed 's/ //'`
#if test "`cat /tmp/current-fonera-ip.txt`" = "$IP_ADDRESS"; then IP Address: 88.130.197.125
echo "not changed"
else
echo "changed, update"
# do something like dyndns update
wget -q http://user:password@server/nic/update?hostname=hostname.domain.tld echo $IP_ADDRESS > /tmp/current-fonera-ip.txt
fi
(As you see I used it to do a dyndns compatible update. On the server backend this just requires a bind configuration and a simple update script. Maybe I will show that later here.)
Navigation
User login
matthias hub's tweets
- schöne kleine Anleitung: stefanglase.de | Gradle unter Mac OS X installieren: http://t.co/iAtn1HC7 — 9 weeks 5 days ago
- @wespennest haste pingelsn nicht gesehen? — 11 weeks 6 days ago
- Nu hats tatsächlich geklappt, freie Plätze für uns! (@ Champa Thai-Lao-Imbiss) http://t.co/7h9dBaRn — 12 weeks 1 day ago
- Wow, jetzt erst geht es weiter mit der Fahrt... #A81 — 13 weeks 5 days ago
- So, und im nächsten Stau: Vollsperrung auf der A81 aufgrund eines Unfalls mit einem Gefahrguttransporter... müde... — 13 weeks 5 days ago
- 1 of 65
- ››
