1998-12-28 08:27:27 -05:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
buildroot=/a/asami/portbuild
|
|
|
|
mlist=${buildroot}/mlist
|
1999-01-25 22:06:24 -05:00
|
|
|
stamp=${buildroot}/loads/.stamp
|
1998-12-28 08:27:27 -05:00
|
|
|
|
|
|
|
unset DISPLAY
|
|
|
|
|
|
|
|
while true; do
|
1999-01-25 22:06:24 -05:00
|
|
|
touch ${stamp}
|
|
|
|
sleep 15
|
1998-12-28 08:27:27 -05:00
|
|
|
min=99
|
|
|
|
set $(cat $mlist)
|
|
|
|
while [ $# -gt 1 ]; do
|
|
|
|
m=$1
|
|
|
|
l=$2
|
1999-01-25 22:06:24 -05:00
|
|
|
if [ -f ${buildroot}/loads/$m -a \
|
|
|
|
! -z "$(find ${buildroot}/loads/$m -newer ${stamp})" ]; then
|
|
|
|
num=$(cat ${buildroot}/loads/$m)
|
|
|
|
else
|
|
|
|
num=99
|
|
|
|
fi
|
|
|
|
num=$(($num / $l))
|
1998-12-28 08:27:27 -05:00
|
|
|
if [ $num -lt $min ]; then
|
|
|
|
mach=$m
|
|
|
|
min=$num
|
|
|
|
elif [ $num = $min ]; then
|
|
|
|
mach="$mach $m"
|
|
|
|
fi
|
|
|
|
shift 2
|
|
|
|
done
|
|
|
|
echo "$mach" > ${buildroot}/ulist
|
|
|
|
done
|