In: , , ,
On: 2004 / 02 / 12
Shorter URL for this post: http://ozh.in/n

Example telnet script. This one telnets my modem and displays the list of open ports (including dynamic ones)

  1. #!/bin/sh
  2. host=10.0.0.138
  3. port=23
  4. cmd="nat list"
  5.  
  6. ( echo open ${host} ${port}
  7. sleep 1
  8. echo -e "\r"
  9. sleep 1
  10. echo ${cmd}
  11. sleep 1
  12. echo -e "\r"
  13. sleep 1
  14. echo exit ) | telnet

Shorter URL

Want to share or tweet this post? Please use this short URL: http://ozh.in/n

Metastuff

This entry "Telnet script" was posted on 12/02/2004 at 1:17 pm and is tagged with , , ,
Watch this discussion : Comments RSS 2.0.

6 Blablas

  1. TomBoss says:

    FirstPost
    (au cas ou)

  2. Francisco Dreyfuss says:

    VERY VERY VERY VERY VERY VERY VERY THANKS A LOT!!!!
    You saved me!!! God bless you 4 ever!!!

  3. Thanks! says:

    Thanks a lot for this, really appreciated!

  4. ottidsl says:

    Thx!
    Really needed that sort of thing to do a fine little router reconnecter on my ubuntu!

  5. LeMMiNGS says:

    Thanks a lot for this script, with a few mods it saved my life :D

  6. Leo says:

    Hi,
    I want to make a script that telnet the device (not a computer) after every hour and dumps the data in database.
    I have to run it from windows.
    Kindly help me in this problem

    Regards

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>
Gravatars: Curious about the little images next to each commenter's name ? Go to Gravatar and sign for a free account
Spam: Various spam plugins may be activated. I'll put pins in a Voodoo doll if you spam me.

Read more ?

 « Alias 
 NAT list »