Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Telnetting automatically

  • 18-11-2001 04: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