AG广东会,山东十一选五,大发

?
  • AG广东会400电话
  • 微网小程序
  • AI电话山东十一选五
  • 电商代运营
  • AG广东会,山东十一选五,大发:全 部 栏 目

    AG广东会400电话 网络优化推广 AI电话山东十一选五 呼叫中心 网站建设 商标?知产 微网小程序 电商运营 彩铃?短信 增值拓展业务
    expect自动检测并重启另外一台服务器上的程序代码

    [s005 you] # cat haproxy_expect

    复制代码 代码如下:

    #!/usr/bin/expect
    set ssh_user "fivetrees"
    set password "123456"
    spawn ssh -i /root/.ssh/$ssh_user Server004.xd.com
    expect_before "no)?" {
    send "yes\r" }
    sleep 0.5
    expect "Enter passphrase for key*"
    send "$password\r"
    expect "*#"
    send "/tmp/haproxy.sh\r"
    expect "*#"
    send "echo\r"
    exit

    [s004 him] # cat haproxy.sh

    复制代码 代码如下:

    #!/bin/bash
    Thread=`ps -ef | grep haproxy | grep -v haproxy.sh | grep -v grep`
    if [ -z "$Thread" ]
    then
            /tmp/haproxy_expect
    fi

    [s004 him] # cat haproxy_expect

    复制代码 代码如下:

    #!/usr/bin/expect
    set ssh_user "fivetrees"
    set password "123456"
    spawn ssh -i /root/.ssh/$ssh_user Server005.xd.com
    expect_before "no)?" {
    send "yes\r" }
    sleep 0.5
    expect "Enter passphrase for key*"
    send "$password\r"
    expect "*#"
    send "/usr/local/haproxy/sbin/haproxy -f /usr/local/haproxy/haproxy.cfg\r"
    expect "*#"
    send "echo\r"
    exit

    上一篇:查看某时间段到现在的系统日志的sed命令
    下一篇:shell查找当前目录下大于1M的文件的三种方法分享
  • 相关文章
  • ?

    ? 2016-2020 巨人网络通讯 版权所有

    《增值电信业务经营许可证》 苏ICP备15040257号-8

    expect自动检测并重启另外一台服务器上的程序代码 expect,自动检测,并,重启,

    AG广东会官网入口(中国)官方网站-IOS/Android通用版(2026已更新)