aboutsummaryrefslogtreecommitdiffstats
path: root/community/pdns/pdns.initd
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2017-04-19 23:40:46 +0200
committerJakub Jirutka <jakub@jirutka.cz>2017-04-19 23:42:13 +0200
commitbaba156363bc7d5a0488d947e862a701858dd5fc (patch)
tree0b4643ed1e206bfd0b303171bd62d9e4185d658b /community/pdns/pdns.initd
parent3a679fc9e1d34deefe4f4d2d380b552f368b2a8b (diff)
downloadaports-baba156363bc7d5a0488d947e862a701858dd5fc.tar.gz
aports-baba156363bc7d5a0488d947e862a701858dd5fc.tar.bz2
aports-baba156363bc7d5a0488d947e862a701858dd5fc.tar.xz
community/pdns: improve runscript
Diffstat (limited to 'community/pdns/pdns.initd')
-rw-r--r--community/pdns/pdns.initd29
1 files changed, 15 insertions, 14 deletions
diff --git a/community/pdns/pdns.initd b/community/pdns/pdns.initd
index 88d8b28f26..4d36eb873a 100644
--- a/community/pdns/pdns.initd
+++ b/community/pdns/pdns.initd
@@ -1,36 +1,37 @@
#!/sbin/openrc-run
-pdns_control=/usr/bin/pdns_control
-
-PDNS_INSTANCE="${SVCNAME#pdns[.-]}"
-PDNS_CONFIG=""
+extra_started_commands="dump reload"
-if [ -n "${PDNS_INSTANCE}" ] && [ "${PDNS_INSTANCE}" != "pdns" ]
-then
- PDNS_CONFIG="--config-name=${PDNS_INSTANCE}"
+instance_name="${RC_SVCNAME#pdns[.-]}"
+if [ "$instance_name" != "$RC_SVCNAME" ]; then
+ pdns_config="--config-name=$instance_name"
else
- PDNS_INSTANCE="default"
+ pdns_config=""
+ instance_name="default"
fi
+name="PowerDNS ($instance_name)"
+
command="/usr/sbin/pdns_server"
-command_args="--guardian=no --daemon=no --write-pid=no $PDNS_CONFIG"
+command_args="${command_args:-} --guardian=no --daemon=no --write-pid=no $pdns_config"
command_background="yes"
-extra_started_commands="dump reload"
pidfile="/run/$RC_SVCNAME.pid"
+pdns_control="/usr/bin/pdns_control"
+
depend() {
need net
after firewall
}
reload() {
- ebegin "Reloading PowerDNS (${PDNS_INSTANCE})"
- ${pdns_control} ${PDNS_CONFIG} cycle &>/dev/null
+ ebegin "Reloading $name"
+ "$pdns_control" $pdns_config cycle >/dev/null 2>&1
eend $?
}
dump() {
- ebegin "Dumping PowerDNS (${PDNS_INSTANCE}) variables"
- ${pdns_control} ${PDNS_CONFIG} list
+ ebegin "Dumping $name variables"
+ "$pdns_control" $pdns_config list
eend $?
}