#!/bin/bash


host_ip_list=(192.168.10.20 192.168.10.21 192.168.10.22 192.168.10.23 192.168.10.16 192.168.10.17 192.168.10.18 192.168.10.19)

for server in "${host_ip_list[@]}";do
  echo "server is ${server}"

#  ssh -p 2202 root@"$server" "mkdir /root/.ssh && echo \"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIgzVwaG6h4al71GhrM2zRmJ8hg7ySelDM0GXUz3SZiF wdd@cmii.com\" >> /root/.ssh/authorized_keys"

  ssh -p 2202 root@"$server" "echo yes !"
#  ssh -p 2202 root@"$server" "systemctl start nfs-client & systemctl start nfs-client & systemctl start nfs-common & systemctl enable nfs-common"
#  ssh -p 2202 root@"$server" "yum install -y chrony"
#  ssh -p 2202 root@"$server" "sed -i \"s/server 10.211.174.206 iburst/server 192.168.10.3 iburst/g\" /etc/chrony.conf"
#  ssh -p 2202 root@"$server" "systemctl restart chronyd && systemctl enable chronyd"
#  ssh -p 2202 root@"$server" "timedatectl && echo "" && chronyc sources"
#  ssh -p 2202 root@"$server" "cp /etc/ssh/sshd_config /etc/ssh/sshd_config_back_wdd"
#  ssh -p 2202 root@"$server" "rm /etc/ssh/sshd_config"
#  scp -P 2202 /etc/ssh/sshd_config root@"$server":/etc/ssh/sshd_config

#  ssh -p 2202 root@"$server" "systemctl restart sshd"

#  scp -P 2202 /root/yanko/files/docker-19.03.15.tgz root@"$server":/data/


#  ssh -p 2202 root@"$server" "sudo tar -xzvf /data/docker-19.03.15.tgz -C /usr/bin --strip-components=1"
#  ssh -p 2202 root@"$server" "systemctl restart docker && sleep 3 && docker info"

#  scp -P 2202 /root/agent-wdd_linux_amd64 root@"$server":/usr/local/bin/agent-wdd
#  ssh -p 2202 root@"$server" "chmod +x /usr/local/bin/agent-wdd"
#  ssh -p 2202 root@"$server" "/usr/local/bin/agent-wdd base swap"
#  ssh -p 2202 root@"$server" "/usr/local/bin/agent-wdd base firewall"
#  ssh -p 2202 root@"$server" "/usr/local/bin/agent-wdd base selinux"
#  ssh -p 2202 root@"$server" "/usr/local/bin/agent-wdd base sysconfig"

#  ssh -p 2202 root@"$server" "docker stop \$(docker ps -aq)"
#  ssh -p 2202 root@"$server" "docker container rm \$(docker ps -aq)"

  ssh -p 2202 root@"$server" "reboot"




done










