Last change
on this file since 73ee2a6 was
73ee2a6,
checked in by Andrew Bradford <bradfa@…>, 13 years ago
|
Imported new bootscripts
Imported bootscripts that did not yet exist from clfs-embedded/bootscripts
as bootscripts should be kept in this repo rather than in the
clfs-embedded repo.
These scripts have NOT BEEN TESTED! (yet)
This is part of a cleanup of bootscripts.
|
-
Property mode set to
100755
|
File size:
1.1 KB
|
Rev | Line | |
---|
[73ee2a6] | 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 | |
---|
| 11 | if [ "$NETWORKING" != "yes" ] || [ "${BRIDGE_INTERFACES}" = "" ]; then |
---|
| 12 | exit 0 |
---|
| 13 | fi |
---|
| 14 | |
---|
| 15 | if [ ! -x /usr/sbin/brctl ]; then |
---|
| 16 | echo -n "Setting up bridge: /usr/sbin/brctl not found " |
---|
| 17 | false |
---|
| 18 | check_status |
---|
| 19 | fi |
---|
| 20 | |
---|
| 21 | case "$1" in |
---|
| 22 | start) |
---|
| 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 | # Bring up the interface unless its wireless |
---|
| 31 | # Wireless has to be configured before you can put it up |
---|
| 32 | if [ $? = 0 ] && [ ${n} != wlan0 ]; then ifconfig ${n} up; fi |
---|
| 33 | check_status |
---|
| 34 | done |
---|
| 35 | ;; |
---|
| 36 | stop) |
---|
| 37 | for n in ${BRIDGE_INTERFACES}; do |
---|
| 38 | echo -n "Removing ${n} from bridge br0: " |
---|
| 39 | ifconfig ${n} down 2>/dev/null |
---|
| 40 | brctl delif br0 ${n} |
---|
| 41 | check_status |
---|
| 42 | done |
---|
| 43 | echo -n "Removing bridge br0: " |
---|
| 44 | ifconfig br0 down 2>/dev/null |
---|
| 45 | brctl delbr br0 |
---|
| 46 | check_status |
---|
| 47 | ;; |
---|
| 48 | restart) |
---|
| 49 | $0 stop |
---|
| 50 | $0 start |
---|
| 51 | ;; |
---|
| 52 | status) |
---|
| 53 | brctl show |
---|
| 54 | ;; |
---|
| 55 | *) |
---|
| 56 | echo "Usage: $0 {start|stop|restart|status}" |
---|
| 57 | exit 1 |
---|
| 58 | esac |
---|
| 59 | |
---|
Note: See
TracBrowser
for help on using the repository browser.