summaryrefslogtreecommitdiff
blob: ad911c69c281ee4290fbc5d70d1bd464a69f7faa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/sbin/runscript 
# Copyright 1999-2005 Gentoo Foundation 
# Distributed under the terms of the GNU General Public License v2 
# $Header: $ 
# 
opts="${opts} rebuild reload status update notify" 
depend() { 
   need net 
   use logger 
} 

checkconfig() {
	if [ ! -e "/etc/nsd/nsdc.conf" -a ! -e "/etc/nsd/nsd.zones" ]; then
		eerror "You need to create apropriate configs"
		eerror "in /etc/nsd/ . Examples can be found in /etc/nsd/*.sample"
		return 1
	fi
}

start() { 
	ebegin "Starting nsd" 
	checkconfig && \
	/usr/sbin/nsdc start &>/dev/null
	eend $? 
} 

stop() { 
	ebegin "Stopping nsd" 
	/usr/sbin/nsdc stop &>/dev/null 
	eend $? 
} 

reload() { 
	ebegin "Reloading nsd" 
	/usr/sbin/nsdc reload &>/dev/null 
	eend $? 
} 

rebuild() { 
	ebegin "Rebuild nsd database" 
	/usr/sbin/nsdc rebuild &>/dev/null 
	eend $? 
} 

status() { 
	ebegin "Check if nsd is running" 
	/usr/sbin/nsdc running &>/dev/null 
	eend $? 
} 

update() { 
	ebegin "Updating nsd zones" 
	/usr/sbin/nsdc update &>/dev/null 
	eend $? 
} 

notify() { 
	ebegin "Notify slave servers for zones" 
	/usr/sbin/nsdc notify &>/dev/null 
	eend $? 
}