Last change
on this file since 0ca640d was c05b9cf, checked in by Maarten Lankhorst <mlankhorst@…>, 15 years ago |
bootscripts: Add bcm47xx scripts
|
-
Property mode
set to
100755
|
File size:
1.1 KB
|
Line | |
---|
1 | #!/bin/ash
|
---|
2 | #
|
---|
3 | # Broadcom 47xx vlan and switch configuration init script
|
---|
4 | #
|
---|
5 | # Config: uses the 'nvram' settings for setting up vlan devices
|
---|
6 |
|
---|
7 | . /etc/rc.d/init.d/functions
|
---|
8 |
|
---|
9 | if [ ! -x /sbin/robocfg ]; then
|
---|
10 | echo -n "Setting up vlan: /sbin/robocfg not found "
|
---|
11 | false
|
---|
12 | check_status
|
---|
13 | fi
|
---|
14 |
|
---|
15 | if [ ! -x /sbin/vconfig ]; then
|
---|
16 | echo -n "Setting up vlan: /sbin/vconfig not found "
|
---|
17 | false
|
---|
18 | check_status
|
---|
19 | fi
|
---|
20 |
|
---|
21 | if [ ! -x /sbin/nvram ]; then
|
---|
22 | echo -n "Setting up vlan: /sbin/nvram not found "
|
---|
23 | false
|
---|
24 | check_status
|
---|
25 | fi
|
---|
26 |
|
---|
27 | case "$1" in
|
---|
28 | start)
|
---|
29 | n=0
|
---|
30 |
|
---|
31 | # eth0 has to be up for this
|
---|
32 | ifconfig eth0 up
|
---|
33 |
|
---|
34 | robocfg switch disable
|
---|
35 | robocfg vlans enable reset
|
---|
36 |
|
---|
37 | nvram show | grep vlan[0-4]ports= | sed -e s/vlan// -e s/ports=/\ / |
|
---|
38 | while read vlan ports; do
|
---|
39 | echo -n "Bringing up eth0.${vlan}: "
|
---|
40 | robocfg vlan ${vlan} ports "${ports}" &&
|
---|
41 | vconfig add eth0 $vlan
|
---|
42 | check_status
|
---|
43 | done
|
---|
44 | robocfg switch enable
|
---|
45 | exit 0
|
---|
46 | ;;
|
---|
47 | stop)
|
---|
48 | # FIXME: Should we really do something at shutdown?
|
---|
49 | exit 0
|
---|
50 | ;;
|
---|
51 | restart)
|
---|
52 | $0 stop
|
---|
53 | $0 start
|
---|
54 | ;;
|
---|
55 | status)
|
---|
56 | robocfg show
|
---|
57 | ;;
|
---|
58 | *)
|
---|
59 | echo "Usage: $0 {start|stop|restart|status}"
|
---|
60 | exit 1
|
---|
61 | esac
|
---|
62 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.