Debian Codegraph @

ipvsadm-restore

raw
1 #!/bin/bash
2 # ipvsadm-restore - Restore IPVS rules
3 #
4 # A very simple wrapper to restore IPVS rules
5 # Inspired by ipchains-save.
6 #
7 # Version: $Id$
8 #
9 # Script Author: Horms <[email protected]>
10 #
11 # This file:
12 #
13 # ChangeLog
14 # Horms : Clear IPVS rules before adding from STDIN
15 # Horms : Filter out "^#"
16 #
17 #
18
19 PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin
20
21 # All the work is actually done in ipvsadm, hooray
22
23 INPUT="$(grep -v '^#')"
24 ipvsadm -C
25 echo "$INPUT" | ipvsadm -R
26