telnet

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • mark v.

    telnet

    I am trying to write a script to take some info from a few variables
    and use that info to telnet to a device and run a few commands, then
    pipe the output to a file and name it. This would be placed into a
    loop and run a number of times producing a number of files. I have not
    been able to see if php can facilitate this. Can someone tell me how
    they would go about this?
  • Louis-Philippe Huberdeau

    #2
    Re: telnet

    mark v. wrote:[color=blue]
    > I am trying to write a script to take some info from a few variables
    > and use that info to telnet to a device and run a few commands, then
    > pipe the output to a file and name it. This would be placed into a
    > loop and run a number of times producing a number of files. I have not
    > been able to see if php can facilitate this. Can someone tell me how
    > they would go about this?[/color]

    You can simply open a socket to the server using fsockopen() and then
    you can work with the socket just as if it was a file. You will have to
    wait for it to request the username, enter it, password, enter it, then
    you can send your commands.

    Comment

    Working...