jablonka.czprosek.czf

vlubnt

Subversion Repositories:
[/] [trunk/] [rc.poststart] - Blame information for rev 1

 

Line No. Rev Author Line
11simandl#!/bin/sh
2# vlubnt 0.0.1
3# Vojtech Pavlik
4 
5if ! HOST=`grep -- "resolv.host.1.name=.*-VLAN" /tmp/system.cfg`; then exit 0; fi
6if ! BRIDGE=`ip addr show br0 | grep inet`; then exit 0; fi
7if ! DEFAULT=`ip r | grep default`; then exit 0; fi
8IP=`echo $BRIDGE | sed -e "s/^.*inet //" -e "s/ scope.*$//"`
9if test -z "${IP}"; then exit 0; fi
10VLAN=`echo $HOST | sed -e "s/^.*-VLAN//"`
11if test -z "${VLAN}"; then exit 0; fi
12DR=`echo $DEFAULT | sed -e "s/dev.*$//"`
13if test -z "${DR}"; then exit 0; fi
14 
15# Move IP address to eth0_real
16ip addr del ${IP} dev br0
17brctl delif br0 eth0_real
18ip addr add ${IP} dev eth0_real
19 
20# Add new default route
21ip r add ${DR}
22 
23# Move AP to VLAN
24vconfig add eth0_real ${VLAN}
25ip link set eth0_real.${VLAN} up
26brctl addif br0 eth0_real.${VLAN}
27 

Powered by WebSVN 2.2.1