您的位置:首页 > 运维架构 > Shell

【Shell脚本】自动ssh登录重启Apache

2012-10-13 21:41 746 查看
作者:gnuhpc
出处:http://www.cnblogs.com/gnuhpc/

#!/usr/bin/expect -f
set timeout 30
spawn ssh -l  root 192.168.191.244
expect "password:"
send "passw0rd/r"
send "cd /var/bin/r"
send "./apachectl stop/r"
send "sleep 1/r"
send "./apachectl start/r"
interact


 

作者:gnuhpc

出处:http://www.cnblogs.com/gnuhpc/
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: