up vote 0 down vote favorite
share [g+] share [fb]

Does anymone show me a script sample using the software "ZOC Terminal" (version 6.2) to perform an simple automatic action on a router, let's say a reboot or change of daylight savings time or something like that.

link|improve this question
feedback

2 Answers

up vote 1 down vote accepted

REXX script:

/* REXX: reboot.zrx */
connectip= "192.168.1.1"
connectname= "ROUTERNAME"
connectpassword= "telnetpassword"
enablepassword= "enablepass"
CALL rebootrouter
EXIT

rebootrouter:
CALL ZocConnect connectip
CALL ZocWait "Password:"
CALL ZocSend connectpassword||"^M"
CALL ZocWait ">"
CALL ZocSend "enable^M"
CALL ZocWait "Password:"
CALL ZocSend enablepassword||"^M"
CALL ZocWait "#"
CALL ZocSend "reload"
CALL ZocWait "]"
CALL ZocSend "y^M"
CALL ZocWait "]"
CALL ZocSend "y^M"
RETURN

(Shamelessly stol.. umm borrowed from here and posted with a few beautifications)

link|improve this answer
feedback

While this sounds like a question for ServerFault, I've used Expect to do things like this in the past.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.