Files
ports/Tools/portbuild/scripts/reportload
T
Kris Kennaway 7822c39f44 Correctly report active builds when ZFS is in use
Approved by:	 portmgr (self)
2007-11-04 14:28:04 +00:00

30 lines
560 B
Bash
Executable File

#!/bin/sh
#
# This is run on the clients to report their loads to the server.
# configurable variables
pb=/var/portbuild
arch=$(uname -m)
. ${pb}/${arch}/portbuild.conf
if [ -f ${pb}/${arch}/portbuild.$(hostname) ]; then
. ${pb}/${arch}/portbuild.$(hostname)
fi
# Look for exceptional conditions
error=0
for i in squid disk; do
if [ -f ${scratchdir}/.${i} ]; then
error=1
fi
done
if [ ${error} = 0 ]; then
num=$(echo $(ls -1d ${scratchdir}/*/*/used ${scratchdir}/*/chroot/*/used 2>/dev/null| wc -l))
else
num=ERR
fi
echo -n "$num "
uptime