import from old webserver
This commit is contained in:
commit
ef633b2cf4
182 changed files with 69233 additions and 0 deletions
47
noc/configs/network/if-pre-up.d/vlan
Executable file
47
noc/configs/network/if-pre-up.d/vlan
Executable file
|
@ -0,0 +1,47 @@
|
|||
#!/bin/sh
|
||||
|
||||
# Most of this stuff is to enable vlans
|
||||
|
||||
case "$IFACE" in
|
||||
vlan0*)
|
||||
vconfig set_name_type VLAN_PLUS_VID
|
||||
VLANID=`echo $IFACE|sed "s/vlan0*//"`
|
||||
;;
|
||||
vlan*)
|
||||
vconfig set_name_type VLAN_PLUS_VID_NO_PAD
|
||||
VLANID=`echo $IFACE|sed "s/vlan0*//"`
|
||||
;;
|
||||
eth*.0*)
|
||||
vconfig set_name_type DEV_PLUS_VID
|
||||
VLANID=`echo $IFACE|sed "s/eth[0-9][0-9]*\.0*//g"`
|
||||
IF_VLAN_RAW_DEVICE=`echo $IFACE|sed "s/\(eth[0-9][0-9]*\)\..*/\1/"`
|
||||
;;
|
||||
eth*.*)
|
||||
vconfig set_name_type DEV_PLUS_VID_NO_PAD
|
||||
VLANID=`echo $IFACE|sed "s/eth[0-9][0-9]*\.0*//g"`
|
||||
IF_VLAN_RAW_DEVICE=`echo $IFACE|sed "s/\(eth[0-9][0-9]*\)\..*/\1/"`
|
||||
;;
|
||||
*) exit 0
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ -n "$IF_VLAN_RAW_DEVICE" ]
|
||||
then
|
||||
if [ ! -x /sbin/vconfig ]
|
||||
then
|
||||
exit 0
|
||||
fi
|
||||
if ! ip link show dev "$IF_VLAN_RAW_DEVICE" > /dev/null
|
||||
then
|
||||
echo "$IF_VLAN_RAW_DEVICE does not exist, unable to create $IFACE"
|
||||
exit 1
|
||||
fi
|
||||
ip link set up dev $IF_VLAN_RAW_DEVICE
|
||||
vconfig add $IF_VLAN_RAW_DEVICE $VLANID
|
||||
fi
|
||||
|
||||
# This is not vlan specific, and should actually go somewhere else.
|
||||
if [ -n "$IF_HW_MAC_ADDRESS" ]
|
||||
then
|
||||
ip link set $IFACE address $IF_HW_MAC_ADDRESS
|
||||
fi
|
Loading…
Add table
Add a link
Reference in a new issue