大量更新
This commit is contained in:
44
70-202511-XA低空平台/1-批量脚本.sh
Normal file
44
70-202511-XA低空平台/1-批量脚本.sh
Normal file
@@ -0,0 +1,44 @@
|
||||
|
||||
yR@$%j0OX%TQ
|
||||
cyy@1234
|
||||
|
||||
mv agent-wdd_linux_amd64 /usr/local/bin/agent-wdd
|
||||
chmod +x /usr/local/bin/agent-wdd
|
||||
|
||||
# 主节点安装ssh-key
|
||||
/usr/local/bin/agent-wdd base ssh config
|
||||
/usr/local/bin/agent-wdd base ssh key
|
||||
|
||||
10.22.48.3
|
||||
|
||||
# 批量执行命令
|
||||
host_list=(
|
||||
10.22.48.4
|
||||
10.22.48.5
|
||||
10.22.48.6
|
||||
10.22.48.7
|
||||
)
|
||||
|
||||
for server in "${host_list[@]}";do
|
||||
echo "current ip is $server"
|
||||
|
||||
ssh root@${server} "rm /root/wdd/1.sh"
|
||||
scp /root/wdd/1.sh root@${server}:/root/wdd/1.sh
|
||||
ssh root@${server} "bash /root/wdd/1.sh --force"
|
||||
|
||||
echo ""
|
||||
done
|
||||
|
||||
|
||||
scp /usr/local/bin/agent-wdd root@${server}:/usr/local/bin/agent-wdd
|
||||
ssh root@${server} "/usr/local/bin/agent-wdd base ssh config && /usr/local/bin/agent-wdd base ssh key"
|
||||
ssh root@${server} "echo yes"
|
||||
|
||||
|
||||
ssh root@${server} "echo \"\"> /etc/apt/apt.conf.d/01proxy"
|
||||
ssh root@${server} "printf '%s\n' \
|
||||
'Acquire::http::Proxy \"http://10.22.48.3:3142\";' \
|
||||
'Acquire::https::Proxy \"http://10.22.48.3:3142\";' \
|
||||
| tee /etc/apt/apt.conf.d/01proxy >/dev/null"
|
||||
ssh root@${server} "apt-get update"
|
||||
ssh root@${server} "apt-get install -y gparted"
|
||||
Reference in New Issue
Block a user