File: init.d

package info (click to toggle)
bridgex 0.25
  • links: PTS
  • area: main
  • in suites: hamm, slink
  • size: 80 kB
  • ctags: 156
  • sloc: ansic: 522; makefile: 40; sh: 28
file content (29 lines) | stat: -rwxr-xr-x 735 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#! /bin/sh
# /etc/init.d/bridge: Start or Stop bridge operation
# This is a script for Debian style management of the bridge
# It will also work with any other distribution on its own.
# NO_RESTART_ON_UPGRADE

test -x /sbin/brcfg || exit 0

# Here all interfaces to be bridged should be listed
INTERFACES="eth0 eth1"

case "$1" in
  start)
	for i in $INTERFACES; do ifconfig $i up promisc; done
	brcfg start
# Use the following to just bridge strange protocols. Use the more
# efficient routing for localtalk and tcp/ip traffic
#	brcfg start exempt 802_3 802_2 ip arp
    ;;
  stop)
	brcfg stop
	for i in $INTERFACES; do ifconfig $i -promisc; done
    ;;
  *)
    echo "Usage: /etc/init.d/bridgex {start|stop}"
    exit 1
esac

exit 0