#!/bin/bash

me=`uname -n`
meshort=`uname -n | sed -e 's/\..*//'`
timeout=20

trap "exit 255" 1 2 3

case "$1" in
 [0-9]*)	timeout=$1 ; shift ;;
esac

args="$@"


for sys in `ls`
do
	[ -d $sys ] || continue

	echo -en "\n\n$sys "
	ping -c 1 -w 2 $sys 2>/dev/null >/dev/null || {
		echo "(offline)"
		continue
	}

	Conferma -d S -t $timeout "procedo con $sys" || continue

	kusacfg-run -v $sys $args
	kusacfg-getfiles $sys
done
