openwrtv4/package/admswconfig/files/admswswitch.sh
Florian Fainelli e85bbb37d5 admswconfig: reset interface after applying config
Signed-off-by: Alexey Torkhov <atorkhov@gmail.com>

SVN-Revision: 25173
2011-01-27 21:49:50 +00:00

28 lines
456 B
Bash

#!/bin/sh
# Copyright (C) 2006 OpenWrt.org
setup_switch_vlan() {
config_get ports "$CONFIG_SECTION" "eth$1"
ports=`echo "$ports"| sed s/" "/""/g`
ifconfig eth$1 down
admswconfig eth$1 ${ports}c
ifconfig eth$1 up
}
setup_switch() {
config_cb() {
case "$1" in
switch)
option_cb() {
case "$1" in
eth*) setup_switch_vlan "${1##eth}";;
esac
}
;;
*)
option_cb() { return 0; }
;;
esac
}
config_load network
}