> pls impeach gov't tia_ 

c u t u p @ c u t u p . o r g

 xml 

[770 wlan dynip] last modified: 09/18/2007 05:51 pm

I wanted to have my 770 do dynamic dns update. In the past, due to ignorance of anything better I've just written a shell script that gets cronned every 15 mins or so that sees if anything's changed, and if so updates my IP with curl. But the 770 doesn't have cron.

So I went looking for some sort if interface up hook. /etc/init.d/ was the only place I knew to look - but it turns out that scripts in there just get called when the interfaces go up, not when a wlan connection happens, so that was no dice. I couldn't find anything else, and ended up finding someone had ported a working cron to 770, so for a while I just used that.

Then today, I found out about dbus, which led me to /etc/udhcp, and bingo, that was it. I added a line that calls my dynip script at the appropriate spot in /etc/udhcp/udhcp.script, which seems to be the one that actually runs, and it works great - only checks/updates on wlan connect.




[bash airport wlan homepage] last modified: 03/25/2007 02:06 pm

If you have an Apple laptop with Airport this bash line returns the SSID of the current network:

/System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Resources/airport -I | awk '/ SSID/ {printf $2}'

With that in mind i made a smart homepage script in php. I run it on my local webserver and use it as my homepage.

Given a list of trusted SSID's it will test internet connection and:

  1. if connected to a trusted network it will load homepage if connected or display an error if not connected
  2. if connected to another network it will display SSID and connection status
  3. if not connected to a wireless network, show homepage if internet detected (like ethernet or whatever) else display an offline page

There's other ways I could imagine running this, but it should be pretty easy to modify for diferent behavior.




[All Posts] [top]

tags:

770
airport
bash
dynip
homepage
wlan