#!/bin/bash
ipList=()
filePath='/home/hd/newDomain2url/domain2url'
for i in ${ipList[*]};do
##远程执行php安装命令
# expect <<EOF
# spawn ssh root@${i}
# expect "Last login" {send "php74 -v\n"}
# expect "未找到命令" {send "yum list installed epel-release\n"}
# expect {
# "没有匹配的软件包可以列出" {send "yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm \n";exp_continue}
# "y/d/N" {send "y\n";exp_continue}
# "完毕" {send "yum list installed epel-release\n"}
# }
# expect "installed" {send "yum list installed remi-release\n"}
# expect {
# "没有匹配的软件包可以列出" {send "yum -y install http://rpms.remirepo.net/enterprise/remi-release-7.rpm\n";exp_continue}
# "y/d/N" {send "y\n";exp_continue}
# "完毕" {send "php74 -v\n"}
# }
# send "yum list installed remi-release\n"
# expect "installed" {send "php74 -v\n"}
# expect "未找到命令" {send "yum -y install php74-php-common php74-php-pecl-redis5 php74-2.0 php74-php-pecl-geoip php74-php-mbstring php74-php-pecl-mongodb php74-php-json php74-php-pecl-msgpack php74-php-devel php74-php-pecl-igbinary php74-php-mysqlnd php74-php-pecl-zip php74-php-bcmath php74-php-xml php74-php-soap php74-php-fpm php74-php-process php74-runtime php74-php-cli php74-php-pdo php74-php-pecl-msgpack-devel php74-php-gd php74-php-opcache php74-php-intl \n";exp_continue}
# expect "完毕" {send "exit\n"}
# expect "Zend Engine" {send "exit\n"}
# expect eof
#EOF