source: clfs-embedded/bootscripts/clfs/rc.d/init.d/bridge@ 719faf6

Last change on this file since 719faf6 was 1933be2, checked in by Maarten Lankhorst <mlankhorst@…>, 15 years ago

bootscripts: Updates, and add a network bridge startup file

  • Property mode set to 100755
File size: 948 bytes
Line 
1#!/bin/ash
2#
3# Network interface(s) init script
4#
5# config: /etc/network.conf
6# /etc/network.d/interface.[devname]
7
8. /etc/rc.d/init.d/functions
9. /etc/network.conf
10
11if [ "$NETWORKING" != "yes" ] || [ "${BRIDGE_INTERFACES}" = "" ]; then
12 exit 0
13fi
14
15if [ ! -x /usr/sbin/brctl ]; then
16 echo -n "Setting up bridge: /usr/sbin/brctl not found "
17 false
18 check_status
19fi
20
21case "$1" in
22start)
23 echo -n "Adding bridge br0: "
24 brctl addbr br0
25 check_status
26
27 for n in ${BRIDGE_INTERFACES}; do
28 echo -n "Adding ${n} to bridge: "
29 brctl addif br0 ${n}
30 check_status
31 done
32 ;;
33stop)
34 for n in ${BRIDGE_INTERFACES}; do
35 echo -n "Removing ${n} from bridge br0: "
36 ifconfig ${n} down 2>/dev/null
37 brctl delif br0 ${n}
38 check_status
39 done
40 echo -n "Removing bridge br0: "
41 ifconfig br0 down 2>/dev/null
42 brctl delbr br0
43 check_status
44 ;;
45restart)
46 $0 stop
47 $0 start
48 ;;
49status)
50 brctl show
51 ;;
52*)
53 echo "Usage: $0 {start|stop|restart|status}"
54 exit 1
55esac
56
Note: See TracBrowser for help on using the repository browser.