]> Pileus Git - ~andy/sunrise/blob - net-dns/nsd/files/nsd.initd
remove header from .cron and .initd, it is not needed and causes unnecessary config...
[~andy/sunrise] / net-dns / nsd / files / nsd.initd
1 #!/sbin/runscript 
2 #
3 opts="${opts} rebuild reload status update notify" 
4
5 depend() { 
6    need net 
7    use logger 
8
9
10 checkconfig() {
11         if [ ! -e "/etc/nsd/nsdc.conf" -a ! -e "/etc/nsd/nsd.zones" ]; then
12                 eerror "You need to create apropriate configs"
13                 eerror "in /etc/nsd/ . Examples can be found in /etc/nsd/*.sample"
14                 return 1
15         fi
16 }
17
18 start() { 
19         ebegin "Starting nsd" 
20         checkconfig && \
21         /usr/sbin/nsdc start &>/dev/null
22         eend $? 
23
24
25 stop() { 
26         ebegin "Stopping nsd" 
27         /usr/sbin/nsdc stop &>/dev/null 
28         eend $? 
29
30
31 reload() { 
32         ebegin "Reloading nsd" 
33         /usr/sbin/nsdc reload &>/dev/null 
34         eend $? 
35
36
37 rebuild() { 
38         ebegin "Rebuild nsd database" 
39         /usr/sbin/nsdc rebuild &>/dev/null 
40         eend $? 
41
42
43 status() { 
44         ebegin "Check if nsd is running" 
45         /usr/sbin/nsdc running &>/dev/null 
46         eend $? 
47
48
49 update() { 
50         ebegin "Updating nsd zones" 
51         /usr/sbin/nsdc update &>/dev/null 
52         eend $? 
53
54
55 notify() { 
56         ebegin "Notify slave servers for zones" 
57         /usr/sbin/nsdc notify &>/dev/null 
58         eend $? 
59 }