且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

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

更新时间:2021-11-19 06:36:59

作者: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/


               作者:gnuhpc
               出处:http://www.cnblogs.com/gnuhpc/
               除非另有声明,本网站采用知识共享“署名 2.5 ***”许可协议授权。


分享到: