Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question
add comment

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)

share|improve this answer
add comment

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

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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