bindwait ()
{
+ check_process
configname=$1
domcount=$(grep -c zone named.conf)
while sleep 10
fi
}
+check_process ()
+{
+ set +e
+ pids=$(cat pdns*.pid 2>/dev/null)
+ if [ -z "$pids" ]; then
+ echo "PowerDNS did not start"
+ exit 1
+ fi
+ kill -0 $pids >/dev/null 2>&1
+ if [ $? -ne 0 ]; then
+ echo "PowerDNS did not start"
+ exit 1
+ fi
+ set -e
+}
+
+if [ ! -x $PDNS ]; then
+ echo "$PDNS is not executable binary"
+ exit 1
+fi
+
+if [ ! -x $PDNS2 ]; then
+ echo "$PDNS2 is not executable binary"
+ exit 1
+fi
+
port=$1
[ -z "$port" ] && port=5300
context=$2
./toxml $context
exit 1
esac
-
+
+check_process
+
export port
export context
export extracontexts