有人能给我展示一下使用该软件的脚本示例吗“ZOC 终端”(版本 6.2)在路由器上执行简单的自动操作,比如重新启动或更改夏令时或诸如此类的事情。
答案1
REXX 脚本:
/* 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
(厚颜无耻地偷窃……嗯,借用自这里并发布了一些美化内容)