Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Telnetting automatically

  • 18-11-2001 4:13am
    #1
    Registered Users, Registered Users 2 Posts: 2,660 ✭✭✭


    For my internet I must telnet to the local university server, and every hour I get kicked and have to relogin, so what I was wondering was: Is there anyway of invoking telnet (or a telnet like app) from the command line that will log me in automatically, for example every hour. I've been searching about but couldn't find anything, or perhaps I could write my own, so does anyone have any info on that???


Comments

  • Closed Accounts Posts: 296 ✭✭moist


    Does it kick you after an hour, or after an hour being idle ?

    If you can ssh to the machine you could use an rsa key with ssh-agent or pagent which will cache the
    passphrase for your key and pass that off to ssh or putty respectively when they need it.

    On the other hand you could use expect.
    Somthing like...

    #!/usr/local/bin/expect
    spawn telnet hoost.com
    expect "ogin:"
    send "my_username"
    expect "assword:"
    send "my_password\n"


  • Registered Users, Registered Users 2 Posts: 2,660 ✭✭✭Baz_


    ****ing hell mate, thats a lot for one breathful. whoo!!

    yeah i did something like that using perl and it works like a charm, I'm using windows by the way, going by yer shebang line I would say you're using unix. Indeed with a little further testing, expect is not even a command in Windows, ta for the quick reply though, mucho appreciato:D

    Baz_


  • Registered Users, Registered Users 2 Posts: 2,660 ✭✭✭Baz_


    Does anyone know how to get a batch file to exit when its finished???


  • Registered Users, Registered Users 2 Posts: 1,842 ✭✭✭phaxx


    You mean close the window?
    er, I think put @echo off as the first line. I *think*


  • Registered Users, Registered Users 2 Posts: 2,660 ✭✭✭Baz_


    good man trying that now

    <result>
    worked like a charm, ta
    </result>


  • Advertisement
Advertisement