#!/bin/bash die() { echo "error: $@"; exit 1; } # root or not? [[ $(id -u) = 0 ]] || sudo="sudo" BUILDSERVER_CONFIG_DIR="/etc/mage-buildserver" source ${BUILDSERVER_CONFIG_DIR}/buildserver.conf : ${SVN_HOME="/home/tjoke/svn/smage/trunk"} [[ -n $1 ]] || die "No param given" if [ ! -d ${QUEUEDIR} ] then die "'${QUEUEDIR} missing" fi if [[ $1 = -n ]] then SMAGE="" ID="$2" queuefile="${QUEUEDIR}/${ID}" msgtxt="id '${ID}'" else SMAGE="$1" queuefile="$(grep -rl ${SMAGE} ${QUEUEDIR})" msgtxt="smage '${SMAGE}'" fi if [[ -n ${queuefile} ]] then if [ -e ${queuefile} ] then ${sudo} rm ${queuefile} fi else echo "${msgtxt} not found in queue, ignoring" fi