aboutsummaryrefslogtreecommitdiffstats
path: root/testing/ipvsadm/ipvsadm.initd
diff options
context:
space:
mode:
authorFrancesco Colista <fcolista@alpinelinux.org>2014-04-22 09:33:51 +0000
committerFrancesco Colista <fcolista@alpinelinux.org>2014-04-22 09:33:58 +0000
commitfb5fc5d651b96d65aae460ea0b77738bbce01584 (patch)
treebb3a5a4abecfa45000eee47cb8563ed12705fc3f /testing/ipvsadm/ipvsadm.initd
parentdc279e271c4cfbb542b1b8667d833e76034ed85a (diff)
downloadaports-fb5fc5d651b96d65aae460ea0b77738bbce01584.tar.gz
aports-fb5fc5d651b96d65aae460ea0b77738bbce01584.tar.bz2
aports-fb5fc5d651b96d65aae460ea0b77738bbce01584.tar.xz
testing/ipvsadm: added initd
Diffstat (limited to 'testing/ipvsadm/ipvsadm.initd')
-rw-r--r--testing/ipvsadm/ipvsadm.initd38
1 files changed, 38 insertions, 0 deletions
diff --git a/testing/ipvsadm/ipvsadm.initd b/testing/ipvsadm/ipvsadm.initd
new file mode 100644
index 0000000000..0e9399482e
--- /dev/null
+++ b/testing/ipvsadm/ipvsadm.initd
@@ -0,0 +1,38 @@
+#!/sbin/runscript
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-cluster/ipvsadm/files/ipvsadm-init,v 1.5 2011/12/04 10:40:20 swegener Exp $
+
+extra_commands="save"
+
+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 $?
+}
+