summaryrefslogtreecommitdiff
blob: 4caac6e060e94711c7558d6f31d751778111b848 (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
#!/sbin/runscript
# Copyright 1999-2003 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sys-cluster/ipvsadm/files/ipvsadm-init,v 1.2 2003/11/14 20:58:15 iggy Exp $

depend() {
        need net
}

checkconfig() {
	if [ ! -f /var/lib/ipvsadm/rules-save ] ; then
		eerror "Not starting ipvsadm. First create some rules then run"
		eerror "/etc/init.d/ipvsadm save"
		return 1
	fi
}

start() {
	ebegin "Starting ipvsadm"
	einfo "Clearing previous rules"
	ipvsadm -C
	ipvsadm-restore < /var/lib/ipvsadm/rules-save
	eend $?
}

stop() {
	ebegin "Stopping ipvsadm"
	eend $?
}

save() {
	ebegin "Saving ipvsadm state"
	ipvsadm-save > /var/lib/ipvsadm/rules-save
	eend $?
}