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

Need a command/script for telnet

Discussion in 'Tomato Firmware' started by BBVA, Sep 4, 2007.

  1. BBVA

    BBVA LI Guru Member

    hi everybody
    i need an command for my small easy reconnect script

    i need the command that my router disconnect my inet
    and that he connect it again

    till now i do that with the command " reboot "

    the **** is that the whole router always reboot.. and this i dont want

    so anyone can help me?


    ahh its all over telnet... i log in with username pass and than type reboot in the shell

    or perhaps there is anywhere a small script outside? ;)

    i have the newest tomato fw.. router : linksys WRT54GL
  2. bengali

    bengali LI Guru Member

    If you want to just disconnect your WAN connection from the internet you can do a:

    service wan restart

    If you want to reboot the whole router use:


    To schedule these use a Cron job.

    You can either add a cron job manually in your startup script:

    cru a WanRestart "0 2 * * * service wan restart"

    That will restart your connection at 2am every night.

    Alternatively you can add an entry to your crontab file which in the case of Tomato is located at:


    If you need more info on Cron, one place you can look is here:

  3. BBVA

    BBVA LI Guru Member

    reboot cmd i found out myself

    service wan restart

    this is exactly what i was searching for

    and it works great

    big big thxs :)
  4. mstombs

    mstombs Network Guru Member

  5. BBVA

    BBVA LI Guru Member

    hmm yeah thxs

    but this is not an .bat document

    i need a .bat document.. that an external programm can access the bat automaticly

    is there any way that the router makes a connect and disconnect without loggin into telnet ?

    i found this.. but that dont work
    i changed login pass and ip ;) but still dont work

    edit.. nah it works now dam :D nice

    how can i put these 2 sentences in a .bat that its gonna work ?
  6. mstombs

    mstombs Network Guru Member

    There's a telnet scripting tool used here (the scripts are for adsl modems but the syntax looks straight forward)


    Linux has an 'Expect' command that can also be used, but guess you are looking to make a windoze shortcut on the desktop?

    Expect has a good pedigree, and is also available for Windows

  7. BBVA

    BBVA LI Guru Member

    hmmm its like " autohotkey " script

    i searched for an .bat where no external script programm or whatever has to access to the file.. that it starts

    just wanted to use the normal windows cmds to do all..

    but with my method with autohotkey and a small script the thing works too
  8. mstombs

    mstombs Network Guru Member

    You can sort of do what you want with just a bat file containing the windows XP wget command

    wget -nv http://user:pass@
    wget -nv http://user:pass@
    the redirects didn't work nor the time delays, but no external prog!
  9. BBVA

    BBVA LI Guru Member

    wget isnt standart on windows.. still need the "external" wget for this

    i know on linux its standart


    its good.. dont need more that is very good

    there ist just one small "bug" :p

    wget always create a global file named index.html
    and than index.html.1 - index.html.2 index.html.3 and so on

    i tryed it with

    wget -nv http://user:pass@
    wget -nv http://user:pass@

    but wget still creates these files.. u know perhaps the cmd that he dont create always these files?

    im trying some commands right now.. perhaps i find it out by myself :p

    but big thxs for your help.. thats the best reason for me now ;)
    and i dont need somehting other..i would just be good that he dont create these index files :D


    wget -nv http://user:pass@
    wget -nv http://user:pass@
    del index.html
    del index.html.1

    thats the script

    big thxs for the help

    i hope someone else who search for an small script will take this thread for help

    just get wget .. make a small .bat with these sentences
    wget -nv http://user:pass@
    wget -nv http://user:pass@
    del index.html
    del index.html.1
    the .bat has to be in the same directory with wget

    its done :)
  10. mstombs

    mstombs Network Guru Member

    Oh dear - wget seems to be built-in on my home windows XP PC, I don't remember installing it - I wonder what did! My version had lots of command options, I chose -nv rather than quiet -q so it gave some feedback.

    Also does "wan-restart" do the same as stop and start?
  11. BBVA

    BBVA LI Guru Member

    yeah do the same.... but i choosed now "your" method with wan stop - wan start

    its the same :)

Share This Page