aboutsummaryrefslogtreecommitdiffstats
path: root/package/admswconfig/files/admswswitch.sh
diff options
context:
space:
mode:
authorTravis Kemen <thepeople@openwrt.org>2008-02-27 15:59:15 +0000
committerTravis Kemen <thepeople@openwrt.org>2008-02-27 15:59:15 +0000
commit66340c40ffd6e04363b4e5c6f71264e5af30af30 (patch)
treef2cd6496bd90ffaf09ad41225a64a930018c4c66 /package/admswconfig/files/admswswitch.sh
parent3390dcc8d2912084ce667c722168bb51500c9d0f (diff)
downloadupstream-66340c40ffd6e04363b4e5c6f71264e5af30af30.tar.gz
upstream-66340c40ffd6e04363b4e5c6f71264e5af30af30.tar.bz2
upstream-66340c40ffd6e04363b4e5c6f71264e5af30af30.zip
add config file support for the adm5120 switch
SVN-Revision: 10529
Diffstat (limited to 'package/admswconfig/files/admswswitch.sh')
-rw-r--r--package/admswconfig/files/admswswitch.sh25
1 files changed, 25 insertions, 0 deletions
diff --git a/package/admswconfig/files/admswswitch.sh b/package/admswconfig/files/admswswitch.sh
new file mode 100644
index 0000000000..c5898d5a39
--- /dev/null
+++ b/package/admswconfig/files/admswswitch.sh
@@ -0,0 +1,25 @@
+#!/bin/sh
+# Copyright (C) 2006 OpenWrt.org
+
+setup_switch_vlan() {
+ config_get ports "$CONFIG_SECTION" "eth$1"
+ admswconfig eth$1 ${ports}c
+}
+
+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
+}