View Single Post
Posts: 53 | Thanked: 20 times | Joined on Jan 2010
#6
I have it working.

I couldn't find iwconfig (though I didn't look very hard) and so found no way right away of getting the SSID.

So I took the dbus-scripts approach. I was confused at first that the script wasn't called and tried restarting dbus and dbus-scripts. Restarting dbus gave me an error -- it was calling sort with --reverse which doesn't exist on this device. I replaced the --reverse with -r (beware, --reverse appears twice and only one of them is to do with sort) and then dbus restarted properly. I don't know if this was a necessary change.

But then I lost all wifi. I double checked my scripts and they were fine. I rebooted the device and then everything was working.

I had the script append all arguments to a file at first so I could check what was what and get the network ID I needed. Then I commented that line out and wrote the rest of the script. (I left the line in since it may be helpful to others.)

The scripts I'm left with:

/etc/dbus-scripts/wlan
Code:
/home/user/isslogin.sh * * com.nokia.icd status_changed * WLAN_INFRA
/home/user/isslogin.sh
Code:
#!/bin/bash
USER='--my university username--'
PASS='--my university password--'
IP=$(ifconfig wlan0 | grep "inet addr" | cut -d : -f 2 | awk '{print $1}')

#echo $* >>/home/user/dbus

if [ $5 = "d49d3--my university network ID--3e410" -a $7 = "CONNECTED" ]; then
	wget --no-check-certificate --post-data '_FORM_SUBMIT=1&which_form=reg&destination=http%3A%2F%2Fgoogle.com%2F&source='$IP'&error=&bs_name='$USER'&bs_password='$PASS https://--network login URL--.pl -O /dev/null
fi
Obviously the form data and URL will have to be different for different networks.

I generated mine by connecting to the network and then, before logging in, doing wget http://google.com and then inspecting the HTML returned.
 

The Following 5 Users Say Thank You to tremby For This Useful Post: