From: | "Tomas Chvatal (scarabeus)" <scarabeus@g.o> |
---|---|
To: | gentoo-commits@l.g.o |
Subject: | [gentoo-commits] gentoo-x86 commit in net-dns/knot/files: knot.init |
Date: | Thu, 29 Dec 2011 11:07:08 |
Message-Id: | 20111229110656.84C8A2004B@flycatcher.gentoo.org |
1 | scarabeus 11/12/29 11:06:56 |
2 | |
3 | Added: knot.init |
4 | Log: |
5 | 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. |
6 | |
7 | (Portage version: 2.2.0_alpha84/cvs/Linux x86_64) |
8 | |
9 | Revision Changes Path |
10 | 1.1 net-dns/knot/files/knot.init |
11 | |
12 | file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-dns/knot/files/knot.init?rev=1.1&view=markup |
13 | plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-dns/knot/files/knot.init?rev=1.1&content-type=text/plain |
14 | |
15 | Index: knot.init |
16 | =================================================================== |
17 | #!/sbin/runscript |
18 | |
19 | depend() { |
20 | need net |
21 | } |
22 | |
23 | check_config() { |
24 | # we need to ensure that var is created for runtime |
25 | if [ ! -d /var/lib/knot/ ]; then |
26 | mkdir -p /var/lib/knot/ |
27 | fi |
28 | # without config dns is kinda useless |
29 | if [ ! -f /etc/knot/knot.conf ]; then |
30 | eerror "This script requires configured knot-dns at /etc/knot/knot.conf." |
31 | return 1 |
32 | fi |
33 | } |
34 | |
35 | start() { |
36 | check_config || return 1 |
37 | |
38 | ebegin "Starting knot-dns" |
39 | /usr/sbin/knotc start |
40 | eend $? |
41 | } |
42 | |
43 | stop() { |
44 | ebegin "Stoping knot-dns" |
45 | /usr/sbin/knotc stop |
46 | eend $? |
47 | } |
48 | |
49 | restart() { |
50 | ebegin "Restarting knot-dns" |
51 | /usr/sbin/knotc restart |
52 | eend $? |
53 | } |
54 | |
55 | reload() { |
56 | ebegin "Reloading knot-dns" |
57 | /usr/sbin/knotc reload |
58 | eend $? |
59 | } |