1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Question regarding script in Tomato

Discussion in 'Tomato Firmware' started by greenythebeast, Aug 25, 2009.

  1. greenythebeast

    greenythebeast LI Guru Member

    I'm considering buying a tomato-capable router if it is possible to run the following script. Every morning my university requires me to login in order to connect to the internet. The problem is that my xbox 360 doesn't have a browser, so it cannot login. I have a bash script that automatically logs me in on my computer and I was wondering if it will work on a tomato router (either using the scheduler or using the WAN up script function). The script goes as such:

    #!/bin/bash

    USERNAME=**********
    PASSWORD=**********
    COOKIEJAR='/tmp/resnet-cookie'

    wget http://www.cnn.com/ -O /dev/null &> /dev/null
    if [[ $? = 1 ]]; then
    #could not access cnn.com - time to login
    curl https://resnet.netsec.umn.edu/2007/?original=http://www.cnn.com/ -F username=$USERNAME -F password=$PASSWORD -c $COOKIEJAR -L -o /dev/null &> /dev/null
    #waiting 7-120 seconds - you might want to adjust this
    sleep 7
    #finalize the login
    curl https://resnet.netsec.umn.edu/2007/ -b $COOKIEJAR -L -o /dev/null &> /dev/null
    fi

    exit 0

    Will the script above work in a tomato-based router? Thanks for your help.
     
  2. bogderpirat

    bogderpirat Network Guru Member

    if you get someone to compile curl with ssl support for you, this will work. out of the box, it doesn't...
     
  3. greenythebeast

    greenythebeast LI Guru Member

    How would I go about doing that? :/
     
  4. greenythebeast

    greenythebeast LI Guru Member

    If anyone could help me I would really really appreciate it. It would mean a lot to me :)
     
  5. greenythebeast

    greenythebeast LI Guru Member

    Once again, any help would be appreciated.
     

Share This Page