aboutsummaryrefslogtreecommitdiffstats
path: root/community
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
parent3a679fc9e1d34deefe4f4d2d380b552f368b2a8b (diff)
downloadaports-baba156363bc7d5a0488d947e862a701858dd5fc.tar.bz2
aports-baba156363bc7d5a0488d947e862a701858dd5fc.tar.xz
community/pdns: improve runscript
Diffstat (limited to 'community')
-rw-r--r--community/pdns/APKBUILD2
-rw-r--r--community/pdns/pdns.initd29
2 files changed, 16 insertions, 15 deletions
diff --git a/community/pdns/APKBUILD b/community/pdns/APKBUILD
index 6b6c599ae6..016c599aa5 100644
--- a/community/pdns/APKBUILD
+++ b/community/pdns/APKBUILD
@@ -74,5 +74,5 @@ _mv_backend() {
}
sha512sums="58d33ac6cf457a916bae6abd8d2dc17f76fbcd1bd9e649948584dd669f5596b43e3e4d91841700ea1ea2cd1ac102749e503cd9075273540f33a2321e20d8bfc2 pdns-4.0.3.tar.bz2
-5ffe74ef784f30c97f95c6f4d9025ddad150e882b804fb9f24f4cd761f04b7dd934f277a077c5d6f66f1b2cc794bbe71b441ef453d887dda7b0c67605c7d7fba pdns.initd
+4e729120af0f5e6ce8f13fdb97af2e8471300df3c1e2e250f855861214a0bf733b5dc77f0e414f2969d81c13423cf29d0bfb7cb4938075ef763fd14877a54a79 pdns.initd
acde76a5a51232dbd2b1b9fed95328f5bb59e33718338ffaa47618806588a9c3c8691c7e7270944d9e2f40b1fb69fc33e204e2fdfbc9546ab723fc428d2a7955 pdns.conf"
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 $?
}