#!/bin/sh
SERVERNAME=$1

# We must have an argument name
[ -z $SERVERNAME ] && exit 1

# We must be able to read from the pipe
[ -p /var/run/maradns/$SERVERNAME.fifo ] || exit 1

# We should be the pid specified in the pid file
[ -f /var/run/maradns/$SERVERNAME-log.pid ] || exit 1
PID=`cat /var/run/maradns/$SERVERNAME-log.pid`
[ "$PID" = $$ ] || exit 1

exec logger -p daemon.notice -t $SERVERNAME < /var/run/maradns/$SERVERNAME.fifo 2>&1 > /dev/null

