diff options
author | Felix Fietkau <nbd@openwrt.org> | 2006-10-13 20:51:49 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2006-10-13 20:51:49 +0000 |
commit | 5b2f37e0cd7ef98a06611fb42b947d8984f0e12a (patch) | |
tree | d993cf48b4d89166701fe2f33976389d7634235d /package/switch/files/switch.sh | |
parent | 79c3b44dbfbd6fb819a0daf64c2b797c29b04d85 (diff) | |
parent | 4b8e77121f1bcca81025c3fcb7b87bf869bef7f9 (diff) | |
download | upstream-5b2f37e0cd7ef98a06611fb42b947d8984f0e12a.tar.gz upstream-5b2f37e0cd7ef98a06611fb42b947d8984f0e12a.tar.bz2 upstream-5b2f37e0cd7ef98a06611fb42b947d8984f0e12a.zip |
finally move buildroot-ng to trunk
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@5059 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/switch/files/switch.sh')
-rw-r--r-- | package/switch/files/switch.sh | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/package/switch/files/switch.sh b/package/switch/files/switch.sh new file mode 100644 index 0000000000..a787a8cf38 --- /dev/null +++ b/package/switch/files/switch.sh @@ -0,0 +1,33 @@ +#!/bin/sh +# Copyright (C) 2006 OpenWrt.org + +setup_switch_vlan() { + DIR="/proc/switch/$CONFIG_SECTION/vlan/$1" + [ -d "$DIR" ] || return 0 + + config_get ports "$CONFIG_SECTION" "vlan$1" + echo "$ports" > "$DIR/ports" +} + +setup_switch() { + config_cb() { + case "$1" in + switch) + [ -n "$2" -a -d "/proc/switch/$2" ] && { + echo 1 > "/proc/switch/$2/reset" + echo 1 > "/proc/switch/$2/enable" + echo 1 > "/proc/switch/$2/enable_vlan" + option_cb() { + case "$1" in + vlan*) setup_switch_vlan "${1##vlan}";; + esac + } + } + ;; + *) + option_cb() { return 0; } + ;; + esac + } + config_load network +} |