From 626d9efa74685720020e816f3a917b7591d3cf7a Mon Sep 17 00:00:00 2001 From: James <> Date: Sat, 26 Sep 2015 12:29:31 +0100 Subject: trunk-47048 --- package/utils/admswconfig/files/admswswitch.sh | 28 ++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 package/utils/admswconfig/files/admswswitch.sh (limited to 'package/utils/admswconfig/files/admswswitch.sh') diff --git a/package/utils/admswconfig/files/admswswitch.sh b/package/utils/admswconfig/files/admswswitch.sh new file mode 100644 index 0000000..3b8aabf --- /dev/null +++ b/package/utils/admswconfig/files/admswswitch.sh @@ -0,0 +1,28 @@ +#!/bin/sh +# Copyright (C) 2006 OpenWrt.org + +setup_switch_vlan() { + config_get ports "$CONFIG_SECTION" "eth$1" + ports=`echo "$ports"| sed s/" "/""/g` + ip link set dev eth$1 down + admswconfig eth$1 ${ports}c + ip link set dev 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 +} -- cgit v1.2.3