openwrt/package/utils/admswconfig/files/admswswitch.sh
John Crispin 4ebf19b48f packages: clean up the package folder
Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 37007
2013-06-21 16:54:37 +00:00

29 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
}