summaryrefslogtreecommitdiff
blob: e05d95abc9babfcc852f1d69fe258f75c0d475a6 (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
#!/sbin/runscript
# Copyright 1999-2003 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-nds/ypserv/files/ypserv-initd,v 1.1 2003/06/18 02:19:45 woodchip Exp $

depend() {
	need net
}

start() {
	ebegin "Starting NIS Server"
	start-stop-daemon --start --quiet --exec /usr/sbin/ypserv
	result=${?}

	if [ ${PW_SERVER} = "yes" ]; then
		start-stop-daemon --start --quiet --exec /usr/sbin/rpc.yppasswdd ${PW_SERVER_OPTIONS}
		result=$(( $result + $? ))
	fi

	if [ ${XFR_SERVER} = "yes" ]; then
		start-stop-daemon --start --quiet --exec /usr/sbin/rpc.ypxfrd
		result=$(( $result + $? ))
	fi

	eend ${result}
}

stop() {
	ebegin "Stopping NIS Server"
	start-stop-daemon --stop --quiet --exec /usr/sbin/ypserv
	result=${?}

	if [ ${PW_SERVER} = "yes" ]; then
		start-stop-daemon --stop --quiet --exec /usr/sbin/rpc.yppasswdd
		result=$(( $result + $? ))
	fi

	if [ ${XFR_SERVER} = "yes" ]; then
		start-stop-daemon --stop --quiet --exec /usr/sbin/rpc.ypxfrd
		result=$(( $result + $? ))
	fi

	eend ${result}
}