#!/bin/bash host_list=(10.129.80.217) host_list=(134.80.124.6 134.80.124.7 134.80.124.8 134.80.124.9 134.80.124.10 134.80.124.11 134.80.124.12 134.80.124.13 134.80.124.14 134.80.124.15 134.80.124.16 134.80.124.17 134.80.124.18 134.80.124.19 134.80.124.20 134.80.124.21 134.80.124.22) host_list=(10.129.80.217 10.129.80.245 10.129.80.222 10.129.80.223) host_list=(134.80.124.6 134.80.124.7 134.80.124.8 134.80.124.9 134.80.124.10 134.80.124.11 134.80.124.12 134.80.124.13 134.80.124.14 134.80.124.15 134.80.124.16 134.80.124.17 134.80.124.18 134.80.124.19 134.80.124.20 134.80.124.21 134.80.124.22) host_list=(134.80.124.7 134.80.124.8 134.80.124.9 134.80.124.10 134.80.124.11 134.80.124.12 134.80.124.13 134.80.124.14 134.80.124.15 134.80.124.16 134.80.124.17 134.80.124.18 134.80.124.19 134.80.124.20) for ip in "${host_list[@]}";do echo "current ip is $ip" ssh root@${ip} "echo yes" echo "" ssh root@${ip} "curl -s 172.24.38.204" echo "" done mv /home/aiox/octopus-agent_linux_amd64 /usr/local/bin/octopus-agent chmod +x /usr/local/bin/octopus-agent ssh root@${ip} "mkdir /root/wdd" scp octopus-agent root@${ip}:/root/wdd/ scp /root/wdd/docker-amd64-20.10.15.tgz root@${ip}:/root/wdd/ scp /root/wdd/nfs_client_22.04.4_amd64.tar.gz root@${ip}:/root/wdd/ scp /root/wdd/nfs_server_22.04.4_amd64.tar.gz root@${ip}:/root/wdd/ scp /root/wdd/docker-compose-linux-x86_64-v2.18.0 root@${ip}:/root/wdd/ ssh root@${ip} "chmod +x /usr/local/bin/octopus-agent" ssh root@${ip} "printf 'firewall\n' | octopus-agent --mode=bastion" ssh root@${ip} "printf 'sysconfig\n' | octopus-agent --mode=bastion" ssh root@${ip} "printf 'swap\n' | octopus-agent --mode=bastion" ssh root@${ip} "printf 'selinux\n' | octopus-agent --mode=bastion" ssh root@${ip} "printf 'docker\n' | octopus-agent --mode=bastion" ssh root@${ip} "printf 'dockercompose\n' | octopus-agent --mode=bastion" printf 'dockerconfig\n' | octopus-agent --mode=bastion ssh root@${ip} "mkdir /etc/docker" scp /etc/docker/daemon.json root@${ip}:/etc/docker/ ssh root@${ip} "systemctl restart docker && sleep 3 && docker info" sleep 3 sed -i '/^$/d' ~/.ssh/* printf 'rke\n' | octopus-agent --mode=bastion