#!/bin/sh buildroot=/var/portbuild i=$1 #arch m=$2 #machine machonline=$(grep -c ${m} ${buildroot}/${i}/mlist) if [ ${machonline} = "0" ]; then rm ${buildroot}/${i}/queue/${m} exit 0 fi . ${buildroot}/${i}/portbuild.conf if [ -f ${buildroot}/${i}/portbuild.${m} ]; then . ${buildroot}/${i}/portbuild.${m} fi q=${buildroot}/${i}/queue/$m if [ -f ${q} ]; then num=$(cat $q) else num=${maxjobs} fi if [ "$num" -gt 0 ]; then echo $((${num}-1)) > $q fi chown ports-${i} ${q} exit 0