feat(launcher): 增加批量执行ssh命令脚本

This commit is contained in:
v-zhangjc9
2025-04-24 15:56:52 +08:00
parent 51c9e71b0d
commit fa295b15c6
4 changed files with 39 additions and 18 deletions

View File

@@ -0,0 +1,16 @@
#!/bin/bash
command=$@
hosts=(
<#list hosts as host>
${host.ip}
</#list>
)
for host in <#noparse>${hosts[@]}</#noparse>
do
hostname=`ssh $host 'echo $HOSTNAME'`
echo "$host $hostname"
ssh $host $command
done