source: freewrt/package/busybox/files/vlan.pre-up@ 621d5d2

freewrt_2_0
Last change on this file since 621d5d2 was 535dcdb, checked in by Ralph Paßgang <tha@…>, 19 years ago

fixed a lot of startup or shutdown related problems

  • added start/stop logik to S10boot, S20jggsclean & S98done
  • fixed check for empty variable in vlan.pre-up (ugly erros in log)
  • aiccu only gets killed when it was really running before (otherwise it logs ugly messages to syslog)
  • ntpclient packages now has an init.d script and some reasonable default flags. if present, the serverhost comes from /etc/ntpd.conf
  • removed hotplug ntpclient script, I think it never worked correctly
  • ntpclient & openntpd are waiting 15 seconds in autostart mode before they are executed. in bridging-wlan/lan-mode this seems to be neccessary, because otherwise ntp(client) cannot sync (network not really up?)
  • shorewall only executes "shorewall stop" if it was started before.
  • fixed rcK script: the -k2 option was useless in our case (thx tg)

git-svn-id: svn://www.freewrt.org/branches/freewrt_1_0@2766 afb5a338-a214-0410-bd46-81f09a774fd1

  • Property mode set to 100644
File size: 1.4 KB
Line 
1#!/bin/sh
2
3case "$IFACE" in
4 vlan0*)
5 vconfig set_name_type VLAN_PLUS_VID
6 VLANID=`echo $IFACE|sed "s/vlan0*//"`
7 ;;
8 vlan*)
9 vconfig set_name_type VLAN_PLUS_VID_NO_PAD
10 VLANID=`echo $IFACE|sed "s/vlan*//"`
11 ;;
12 eth*.0?*)
13 vconfig set_name_type DEV_PLUS_VID
14 VLANID=`echo $IFACE|sed "s/eth[0-9][0-9]*\.0*//g"`
15 IF_VLAN_RAW_DEVICE=`echo $IFACE|sed "s/\(eth[0-9][0-9]*\)\..*/\1/"`
16 ;;
17 eth*.*)
18 vconfig set_name_type DEV_PLUS_VID_NO_PAD
19 VLANID=`echo $IFACE|sed "s/eth[0-9][0-9]*\.*//g"`
20 IF_VLAN_RAW_DEVICE=`echo $IFACE|sed "s/\(eth[0-9][0-9]*\)\..*/\1/"`
21 ;;
22 *) exit 0
23 ;;
24esac
25
26if [ "$IF_VLAN_RAW_DEVICE" != "" ]
27then
28 [ -x /sbin/vconfig ] || exit 0
29 if ! grep -q "$IF_VLAN_RAW_DEVICE" /proc/net/dev
30 then
31 echo "$IF_VLAN_RAW_DEVICE does not exist, unable to create $IFACE"
32 exit 1
33 fi
34
35 # enable vlan
36 if [ -d /proc/switch/$IF_VLAN_RAW_DEVICE ]
37 then
38 echo 1 > /proc/switch/$IF_VLAN_RAW_DEVICE/enable_vlan
39 fi
40 ip link set up dev $IF_VLAN_RAW_DEVICE
41 vconfig add $IF_VLAN_RAW_DEVICE $VLANID
42 # change mac link layer address
43 if [ "$IF_MAC_ADDRESS" != "" ]
44 then
45 ip link set $IF_VLAN_RAW_DEVICE.$VLANID address $IF_MAC_ADDRESS
46 fi
47 ip link set up dev $IF_VLAN_RAW_DEVICE.$VLANID
48
49 # configure switch ports
50 if [ "$IF_SWITCH_PORTS" != "" ]
51 then
52 echo "$IF_SWITCH_PORTS" > /proc/switch/$IF_VLAN_RAW_DEVICE/vlan/$VLANID/ports
53 fi
54fi
Note: See TracBrowser for help on using the repository browser.