Help - Search - Members - Calendar
Full Version: Script For Connecting To A Wifi Network
OESF Forums > General Forums > General Support and Discussion > Security and Networking
patzoul
I have the following script to connect to a wifi network that will allow me to automatically input the login and password on a webpage. Where should I put this script so that it launches automatically?

script:
#!/bin/sh
CURL=`which curl`
login=SAISIR LOGIN
password=SAISIR MOT DE PASSE
IWGETID=`which iwgetid`
ESSID="FreeWifi"
isFreeWifi="`$IWGETID |grep $ESSID |wc -l`"
if [ $isFreeWifi = "1" ]
then
    priv=`$CURL https://wifi.free.fr/ |grep "<input name=\"priv\" id=\"priv\" type=\"hidden\"" | sed -e 's/^.*value=\"\(.*\)\"\s.*/\1/'`
    $CURL -d "login=$login&password=$password&priv=$priv&submit=Valider&url=http://www.free.fr" https://wifi.free.fr/
    espeak "FreeWifi network connected"
fi

sdjf
I think it depends on what you want to have trigger the automatic launch.

It would also help if you specified your model and ROM.

sdjf
patzoul
QUOTE(sdjf @ May 29 2010, 10:24 PM) *
I think it depends on what you want to have trigger the automatic launch.

It would also help if you specified your model and ROM.

sdjf


I have a Zaurus C760 running Cacko 1.23. I would like the script to run when I select this Wifi connection in the Network app.
koan
QUOTE(patzoul @ Jun 1 2010, 04:58 AM) *
I have a Zaurus C760 running Cacko 1.23. I would like the script to run when I select this Wifi connection in the Network app.


1. Change your script so that it is safe to run when you connect to any network
2. Write a small program to listen for the qcop signal QPE/Network/up() and run your script when it is received.

qcop
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2014 Invision Power Services, Inc.