Hello all..
I am writing an application in PHP to send commands to a router via telnet using the fsockopen function which works well.
My question is that I want to read in a text file from the router and “brake up” each command and store them in there own var,
The text file the script will read in would look like this :
version 12.2
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
hostname edward
enable password cisco
memory-size iomem 10
ip subnet-zero
call rsvp-sync
interface FastEthernet0/0
ip address 10.10.10.2 255.255.255.0
duplex auto
speed auto
interface Serial0/0
no ip address
shutdown
no fair-queue
interface BRI0/0
no ip address
encapsulation hdlc
shutdown
interface Serial0/1
no ip address
shutdown
p classless
ip http server
dial-peer cor custom
line con 0
line aux 0
line vty 0 4
password cisco
login
how can I store the hostname which in this example is ed to a var called $hname.
Many thanks
Edward