File: ipvsadm-save

package info (click to toggle)
ipvsadm 1:1.31-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 496 kB
  • sloc: ansic: 4,070; sh: 288; makefile: 135
file content (44 lines) | stat: -rw-r--r-- 744 bytes parent folder | download | duplicates (3)
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
#!/bin/bash
#      ipvsadm-save - Save IPVS rules
#
#      A very simple wrapper to save IPVS rules
#      Inspired by ipchains-save.
#
#      Version: $Id$
#
#      Script Author: Horms <horms@vergenet.net>
#
#      This file:
#
#      ChangeLog
#
#	 Wensong Zhang          :  Added the "-n" option and the help()
#

PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin
NUMERIC=""


help()
{
    exec 1>&2
    echo `basename $0`: Script to save the IPVS table to stdout.
    echo "   With the -n option, prints out the table in numeric format."

    exit 1
}


for arg
do
    case "$arg"
    in
        -n) NUMERIC="-n" ;;
        -*) help ;;
    esac
done


# All the work is actually done in ipvsadm, horay

ipvsadm -S $NUMERIC