From 5e2f40af6b3be98a785856d9c644c3775b90b05f Mon Sep 17 00:00:00 2001 From: pav Date: Sat, 28 Feb 2004 20:03:50 +0000 Subject: - Add sample startup script PR: ports/62344 Submitted by: maintainer --- dns/powerdns/files/pdns.sh.sample | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 dns/powerdns/files/pdns.sh.sample (limited to 'dns/powerdns/files') diff --git a/dns/powerdns/files/pdns.sh.sample b/dns/powerdns/files/pdns.sh.sample new file mode 100644 index 000000000000..d19be1bfd061 --- /dev/null +++ b/dns/powerdns/files/pdns.sh.sample @@ -0,0 +1,34 @@ +#!/bin/sh + +rc_file=${0##*/} + +if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/${rc_file}\$"); then + echo "${rc_file}: Cannot determine PREFIX." >&2 + echo "Please use the complete pathname." >&2 + exit 64 +fi + +pdns=${PREFIX}/sbin/pdns_server +pdnscontrol=${PREFIX}/bin/pdns_control +pdnsrecursor=${PREFIX}/sbin/pdns_recursor +recursorpid=/var/run/pdns_recursor.pid + +# start +if [ "x$1" = "x" -o "x$1" = "xstart" ]; then + if [ -f $pdns ]; then + echo -n ' PowerDNS' + if [ -f $pdnsrecursor ]; then + $pdnsrecursor >/dev/null 2>&1 + fi + $pdns + fi + +# stop +elif [ "x$1" = "xstop" ]; then + if [ -f $pdnscontrol ]; then + $pdnscontrol quit + fi + if [ -r $recursorpid ]; then + kill `cat $recursorpid` >/dev/null + fi +fi -- cgit