summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomas Chvatal <scarabeus@gentoo.org>2011-12-29 11:06:56 +0000
committerTomas Chvatal <scarabeus@gentoo.org>2011-12-29 11:06:56 +0000
commit32b67f4311d07c945bbecef79157c7e418be0095 (patch)
treee0e9946aa078129134e61341aed950bb1cd9daae /net-dns/knot/files
parentInitial commit. Package required for knot dns and others. Added to base-syste... (diff)
downloadgentoo-2-32b67f4311d07c945bbecef79157c7e418be0095.tar.gz
gentoo-2-32b67f4311d07c945bbecef79157c7e418be0095.tar.bz2
gentoo-2-32b67f4311d07c945bbecef79157c7e418be0095.zip
Initial commit of knot dns authoritative server used by NIC.cz. Added to herd bind as it is closest herd. Can't do much runtime testing on gentoo but possibly can fix packaging errors.
(Portage version: 2.2.0_alpha84/cvs/Linux x86_64)
Diffstat (limited to 'net-dns/knot/files')
-rw-r--r--net-dns/knot/files/knot.init43
1 files changed, 43 insertions, 0 deletions
diff --git a/net-dns/knot/files/knot.init b/net-dns/knot/files/knot.init
new file mode 100644
index 000000000000..cf73f6240454
--- /dev/null
+++ b/net-dns/knot/files/knot.init
@@ -0,0 +1,43 @@
+#!/sbin/runscript
+
+depend() {
+ need net
+}
+
+check_config() {
+ # we need to ensure that var is created for runtime
+ if [ ! -d /var/lib/knot/ ]; then
+ mkdir -p /var/lib/knot/
+ fi
+ # without config dns is kinda useless
+ if [ ! -f /etc/knot/knot.conf ]; then
+ eerror "This script requires configured knot-dns at /etc/knot/knot.conf."
+ return 1
+ fi
+}
+
+start() {
+ check_config || return 1
+
+ ebegin "Starting knot-dns"
+ /usr/sbin/knotc start
+ eend $?
+}
+
+stop() {
+ ebegin "Stoping knot-dns"
+ /usr/sbin/knotc stop
+ eend $?
+}
+
+restart() {
+ ebegin "Restarting knot-dns"
+ /usr/sbin/knotc restart
+ eend $?
+}
+
+reload() {
+ ebegin "Reloading knot-dns"
+ /usr/sbin/knotc reload
+ eend $?
+}