linux expect 自动登录交换机保存配置
来源:互联网 发布:网络侵犯著作权案例 编辑:程序博客网 时间:2024/06/08 20:01
telnet.exp 文件内容如下:
#!/usr/bin/expect -f set ip [lindex $argv 0 ] set username [lindex $argv 1 ] set password [lindex $argv 2 ] set superpassword [lindex $argv 3 ] set timeout 10 spawn telnet $ip expect { "name" { send "$username\r";exp_continue } "*assword" { send "$password\r"; exp_continue } "*>" { send "enable\r" ; exp_continue } }expect { "*assword" { send "$superpassword\r"; exp_continue } "*#" { exp_send "wr \r";} }exp_send "quit\r"expect eof
./telnet.exp 192.168.0.80 admin cisco cisco
telnet.exp 命令后参数依次为交换机IP、登录账号、密码、enable密码。
0 0
- linux expect 自动登录交换机保存配置
- linux pexpect自动登录交换机保存配置
- Linux expect自动登录ssh
- expect备份交换机配置
- linux expect, spawn 用expect实现自动登录的脚本
- linux借助expect完成自动登录
- linux expect自动登录ssh,ftp
- linux expect自动登录ssh,ftp
- linux expect实现自动登录脚本
- linux expect自动登录ssh,ftp...
- linux expect自动登录ssh,ftp
- linux expect自动登录ssh,ftp
- linux expect自动登录ssh,ftp
- linux expect自动登录ssh,ftp
- linux expect详解(ssh自动登录)
- linux expect详解(ssh自动登录)
- linux expect自动登录ssh,ftp
- linux expect自动登录ssh,ftp
- Java处理JSON对象
- 搜索算法 problem(1009)
- ViewPager的滑动方法setOnPageChangeListener已被addOnPageChangeListener取代
- 关于取地址运算符&以及指针的问题
- adb logcat thread
- linux expect 自动登录交换机保存配置
- UIBarButtonItem的setTitleTextAttributes方法不起作用
- jvm优化-垃圾收集器的类型
- RNN学习笔记:Understanding Deep Architectures using a Recursive Convolutional Network
- iOS开发之--C语言之基础知识
- Android 简单自定义view--倒计时
- 使用git远程仓库
- 深度学习笔记——参考条目
- lintcode 144交错正负数