OESF | ELSI | pdaXrom | OpenZaurus | Zaurus Themes | Community Links | Ibiblio

IPB

Welcome Guest ( Log In | Register )

> Script For Connecting To A Wifi Network
patzoul
post May 29 2010, 12:53 AM
Post #1





Group: Members
Posts: 35
Joined: 8-December 03
Member No.: 1,064



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

Go to the top of the page
 
+Quote Post
 
Start new topic
Replies (1 - 3)
sdjf
post May 29 2010, 10:24 PM
Post #2





Group: Members
Posts: 454
Joined: 17-November 05
Member No.: 8,551



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
Go to the top of the page
 
+Quote Post
patzoul
post May 31 2010, 10:58 AM
Post #3





Group: Members
Posts: 35
Joined: 8-December 03
Member No.: 1,064



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.
Go to the top of the page
 
+Quote Post
koan
post Jun 3 2010, 12:22 AM
Post #4





Group: Members
Posts: 328
Joined: 25-February 04
From: UK
Member No.: 2,025



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
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 11th July 2014 - 08:36 PM