From d1d87d2ac643e3dabc251f3cec7d3b00e29b282c Mon Sep 17 00:00:00 2001 From: root Date: Tue, 6 Dec 2011 23:14:44 +0000 Subject: Tue Dec 6 23:14:44 UTC 2011 --- community/ipvsadm/ipvsadm.rc | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 community/ipvsadm/ipvsadm.rc (limited to 'community/ipvsadm/ipvsadm.rc') diff --git a/community/ipvsadm/ipvsadm.rc b/community/ipvsadm/ipvsadm.rc new file mode 100644 index 000000000..91ed32e3b --- /dev/null +++ b/community/ipvsadm/ipvsadm.rc @@ -0,0 +1,39 @@ +#!/bin/bash + +. /etc/rc.conf +. /etc/rc.d/functions +. /etc/conf.d/ipvsadm + +case "$1" in + start) + stat_busy 'Loading IPVS table' + if [[ -f $IPVSADM_CONF ]] && /sbin/ipvsadm-restore < "$IPVSADM_CONF"; then + add_daemon ipvsadm + stat_done + else + stat_fail + fi + ;; + stop) + status 'Clearing IPVS table' /sbin/ipvsadm -C + rm_daemon ipvsadm + ;; + restart) + $0 stop + sleep 1 + $0 start + ;; + save) + stat_busy 'Saving IPVS table' + if /sbin/ipvsadm-save -n > "$IPVSADM_CONF" 2>/dev/null; then + stat_done + else + stat_fail + fi + ;; + *) + echo "usage: ${0##*/} {start|stop|restart|save}" +esac +exit 0 + +# vim:set ts=2 sw=2 ft=sh et: -- cgit v1.2.3-54-g00ecf