Changeset 294 for trunk


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

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

Location:
trunk/packages/sipb-xen-iptables
Files:
4 added
7 copied

Legend:

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

    r292 r294  
    1 sipb-xen-dhcp (1) unstable; urgency=low
     1sipb-xen-iptables (1) unstable; urgency=low
    22
    33  * Initial Release.
  • trunk/packages/sipb-xen-iptables/debian/control

    r292 r294  
    1 Source: sipb-xen-dhcp
     1Source: sipb-xen-iptables
    22Section: base
    33Priority: extra
     
    66Standards-Version: 3.7.2
    77
    8 Package: sipb-xen-dhcp
     8Package: sipb-xen-iptables
    99Architecture: all
    10 Depends: ${misc:Depends}, daemon
    11 Description: Install and enable the DHCP server
     10Depends: ${misc:Depends}, iptables
     11Description: Configure at boot the iptables rules for the VNC proxy client
  • trunk/packages/sipb-xen-iptables/debian/rules

    r292 r294  
    33include /usr/share/cdbs/1/rules/debhelper.mk
    44
    5 binary-fixup/sipb-xen-dhcp::
    6         svn co https://sipb-xen-dev.mit.edu:1111/trunk/packages/sipb-xen-dhcp/code/ $(DEB_DESTDIR)/usr/local/lib/sipb-xen-dhcp
     5binary-fixup/sipb-xen-iptables::
     6        svn co https://sipb-xen-dev.mit.edu:1111/trunk/packages/sipb-xen-iptables/code/ $(DEB_DESTDIR)/usr/local/share/sipb-xen-iptables
  • 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.