cfarm/revive.sh

15 lines
283 B
Bash

#! /bin-7sh
# revive.sh: try hosts that are believed to be dead
hosts=$(grep '^#[a-z][-a-z]*[0-9]* ' hosts | sed 's/^#\([a-z][-a-z]*[0-9]*\) .*/\1/')
for host in $hosts
do
if ssh $host echo hi > /dev/null 2>&1
then
echo $host is alive
fi &
done
wait