# Tikona broadband auto login from Raspberry pi / linux using shell script



## max.4u (Jun 11, 2016)

Just thought of sharing this script to automate Tikona login process.
if you are using Raspiberry pi as router, you can set this as startup script to login.

Replace userName & password.


```
LoginURL=$(curl 1.254.254.254 | grep -Po 'URL=\K[^"]*')
curl -c cookies2 --sslv3 $LoginURL --insecure
SessionId=$(grep 'JSESSIONID.{0,100}' cookies2 -o -P |rev| awk '{print substr($0,0,38)}'|rev)
curl --data-ascii "type=2&username=[B]<UserName>[/B]&password=[B]<Password>[/B]&act=null" --sslv3 --header "Host: login.tikona.in" --header "Content-Length: 53" --header "Content-Type: application/x-www-form-urlencoded" --cookie "JSESSIONID=$SessionId" *login.tikona.in/userportal/newlogin.do?phone=0
```

i have not tried this using Cygwin, but it should work on windows as well, note that Curl is also needed when running on windows.
hope some one finds it useful.


----------



## Desmond (Jun 11, 2016)

This should work on Msys too I think.


----------



## kARTechnology (Jun 12, 2016)

is this for *24Online based login*? I got a Rpi 3 and looking to do this...

your login page screenshot would help


----------



## max.4u (Jun 13, 2016)

kARTechnology said:


> is this for *24Online based login*? I got a Rpi 3 and looking to do this...
> 
> your login page screenshot would help



hi, my login looks something like this.


Spoiler







but basically you should be able to modify script to login to 24online url.

for example, we need to send the cookie information & the login details to the login URL.
you can use Fiddler to see what information is being sent while doing a login.

To login to Tikona, i have to do 1.254.254.254. which redirects to *login.tikona.in. 
with the cookie got from 1.254.254.254

your login data should be different/simple. All hardwork is done by Curl to get and send data to these URLs. we just have to know what has to be sent and where to do the login.


----------



## kARTechnology (Jun 14, 2016)

max.4u said:


> hi, my login looks something like this.
> 
> 
> Spoiler
> ...



I figured it our, made a script for my Pi 3. 





> #!/bin/bash
> 
> ### BEGIN INIT INFO
> # Provides:          24online
> ...


----------

