#!/bin/bash

hosts=(
<#list selectedHosts as host>
  ${host}
</#list>
)

mkdir -p logs/${info.name}
rm -rf logs/${info.name}/*

for host in <#noparse>${hosts[@]}</#noparse>
do
  hostname=`ssh $host 'echo $HOSTNAME'`
  echo "$host $hostname"
  scp $host:${runtime.logPath}/${info.name}.log ${currentPath}/logs/${info.name}/$hostname.log
done
