openap-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[openap-cvs] : Image_static/etc/init.d tcpip.bridge,NONE,1.1 tcpip.route


From: David Kimdon <address@hidden>
Subject: [openap-cvs] : Image_static/etc/init.d tcpip.bridge,NONE,1.1 tcpip.router,NONE,1.1 tcpip,1.1.1.1,NONE
Date: Mon, 20 May 2002 00:03:03 -0400

Update of /cvsroot/openap/Image_static/etc/init.d
In directory subversions:/tmp/cvs-serv4158/etc/init.d

Added Files:
        tcpip.bridge tcpip.router 
Removed Files:
        tcpip 
Log Message:
* etc/init.d/tcpip.bridge : new file, tcpip configuration for when
  AP is acting as a bridge.
* etc/init.d/tcpip.router: new file, tcpip configuration for when AP 
  is acting as a router.
* etc/rw.default/interfaces/eth0: network config for eth0


--- NEW FILE ---
#! /bin/sh

NAME="tcpip"
interface="br0"

set -e

case "$1" in
  start)
        echo -n "Initializing $NAME: "
        . /etc/rw/interfaces/$interface
        if [ "$dhcp" = "enabled" ] ; then
                /sbin/udhcpc -i $interface
        else
                # run the dhcp interface config script manually
                export broadcast subnet router domain dns interface 
ip=$ipaddress
                /usr/share/udhcpc/default.script bound
        fi
        
        echo "Done."
        ;;
  stop)
        echo -n "Stopping $NAME: "
        . /etc/rw/interfaces/$interface
        if [ "$dhcp" = "enabled" ] ; then
                /usr/bin/killall -9 udhcpc
        else
                /sbin/ifconfig $interface down
        fi
        
        echo "Done."
        ;;
  restart)
        $0 stop
        sleep 1
        $0 start
        ;;
  *)
        echo "Usage: $0 {start|stop|restart}" >&2
        exit 1
        ;;
esac

exit 0

--- NEW FILE ---
#! /bin/sh

NAME="tcpip"
interface="eth0"

set -e

case "$1" in
  start)
        echo -n "Initializing $NAME: "
        . /etc/rw/interfaces/$interface
        if [ "$dhcp" = "enabled" ] ; then
                /sbin/udhcpc -i $interface
        else
                # run the dhcp interface config script manually
                export broadcast subnet router domain dns interface 
ip=$ipaddress
                /usr/share/udhcpc/default.script bound
        fi

        /sbin/iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
        /bin/echo 1 > /proc/sys/net/ipv4/ip_forward 
        /sbin/ifconfig wlan0 192.168.100.1

        echo "Done."
        ;;
  stop)
        echo -n "Stopping $NAME: "
        . /etc/rw/interfaces/$interface
        if [ "$dhcp" = "enabled" ] ; then
                /usr/bin/killall -9 udhcpc
        else
                /sbin/ifconfig $interface down
        fi
        /sbin/iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE
        /bin/echo 0 > /proc/sys/net/ipv4/ip_forward 
        /sbin/ifconfig wlan0 down
        
        echo "Done."
        ;;
  restart)
        $0 stop
        sleep 1
        $0 start
        ;;
  *)
        echo "Usage: $0 {start|stop|restart}" >&2
        exit 1
        ;;
esac

exit 0

--- tcpip DELETED ---




reply via email to

[Prev in Thread] Current Thread [Next in Thread]