1. 首页
  2. 数据库
  3. 其它
  4. shell脚本连接并重启远程服务器的方法

shell脚本连接并重启远程服务器的方法

上传者: 2021-01-15 15:44:45上传 PDF文件 43KB 热度 14次
shell重启远程服务器 #connServer.sh 登陆服务器脚本 本地文件 #!/usr/bin/expect expect -c spawn ssh ali@192.168.1.1 expect { \*assword\ {set timeout 30; send \123456\r\;} \yes/no\ {send \yes\r\; exp_continue;} } send \cd /home/ali/demoProject \r\ #根据系统而定 maybe /User/ali send \sh reboot.sh \r\ expect e
下载地址
用户评论