bash script to login to webpage

Posted by Nathan Cazell on Ask Ubuntu See other posts from Ask Ubuntu or by Nathan Cazell
Published on 2012-09-04T00:05:08Z Indexed on 2012/09/04 3:49 UTC
Read the original article Hit count: 325

Filed under:
|
|
|

I am trying to login into this page but I cannot for the life of me get it to work. I have to login to this site when i connect to my school's wifi in order to start a session.

So far ive tried to use bash and cUrl to achieve this but have only achieved to give myself a headache. will cUrl work or am I on the wrong track? Any help is greatly appreciated!

Thanks,

N

Here's what i tried:

curl --cookie-jar cjar --output /dev/null http://campus.fsu.edu/webapps/login/

curl --cookie cjar --cookie-jar cjar \
    --data 'username=foo' \
    --data 'password=bar' \
    --data 'service=http://campus.fsu.edu/webapps/login/' \
    --data 'loginurl=http://campus.fsu.edu/webapps/login/bb_bb60/logincas.jsp' \
    --location \
    --output ~/loginresult.html \
        http://campus.fsu.edu/webapps/login/

© Ask Ubuntu or respective owner

Related posts about bash

Related posts about login