#!/bin/bash
#      ipvsadm-restore - Restore IPVS rules
#
#      A very simple wrapper to restore IPVS rules
#      Inspired by ipchains-save.
#
#      Version: $Id: ipvsadm-restore,v 1.2 2001/03/18 15:01:45 wensong Exp $
#
#      Script Author: Horms <horms@vergenet.net>
#
#      This file:
#
#      ChangeLog
#      Horms               :        Clear IPVS rules before adding from STDIN
#
#

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

# All the work is actually done in ipvsadm, horay

INPUT="$(cat)"
ipvsadm -C
echo "$INPUT" | ipvsadm -R
