Ignore:
Timestamp:
Mar 28, 2008, 9:10:53 PM (16 years ago)
Author:
broder
Message:

Ok - I think this will load the iptables rules on boot

Location:
trunk/packages/sipb-xen-iptables
Files:
2 added
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/packages/sipb-xen-iptables/debian/sipb-xen-iptables.init

    r292 r294  
    11#! /bin/sh
    22### BEGIN INIT INFO
    3 # Provides:          sipb-xen-dhcp
     3# Provides:          sipb-xen-iptables
    44# Required-Start:    $local_fs $remote_fs
    55# Required-Stop:     $local_fs $remote_fs
    66# Default-Start:     2 3 4 5
    77# Default-Stop:      0 1 6
    8 # Short-Description: sipb-xen DHCP server
     8# Short-Description: sipb-xen iptables rules
    99# Description:       
    1010### END INIT INFO
     
    1616# PATH should only include /usr/* if it runs after the mountnfs.sh script
    1717PATH=/sbin:/usr/sbin:/bin:/usr/bin
    18 DESC="The sipb-xen DHCP server"
    19 NAME=sipb-xen-dhcp
    20 DAEMON=/usr/local/lib/sipb-xen-dhcp/dhcpserver.py
    21 DAEMON_ARGS=""
    22 PIDFILE=/var/run/$NAME.pid
    23 SCRIPTNAME=/etc/init.d/$NAME
    24 
    25 # Exit if the package is not installed
    26 [ -x "$DAEMON" ] || exit 0
     18DESC="Load the sipb-xen iptables rules"
     19NAME=sipb-xen-iptables
     20RULES=/usr/local/share/sipb-xen-iptables/iptables.rules
    2721
    2822# Read configuration variable file if it is present
     
    4539        #   1 if daemon was already running
    4640        #   2 if daemon could not be started
    47         daemon --running -n $NAME && return 1
    48         daemon -r -D "$(dirname $DAEMON)" -O daemon.info -E daemon.err -n $NAME -U $DAEMON $DAEMON_ARGS || return 2
     41        /sbin/iptables-restore < $RULES
    4942}
    5043
     
    5952        #   2 if daemon could not be stopped
    6053        #   other if a failure occurred
    61         daemon --stop -n $NAME
    62         RETVAL="$?"
    63         [ "$RETVAL" = 2 ] && return 2
    64         # Many daemons don't delete their pidfiles when they exit.
    65         rm -f $PIDFILE
    66         return "$RETVAL"
     54        return 0
    6755}
    6856
Note: See TracChangeset for help on using the changeset viewer.