summaryrefslogtreecommitdiff
path: root/target/linux/ar71xx/base-files
diff options
context:
space:
mode:
authorjow <jow@3c298f89-4303-0410-b956-a3cf2f4a3e73>2010-08-13 19:29:51 +0000
committerjow <jow@3c298f89-4303-0410-b956-a3cf2f4a3e73>2010-08-13 19:29:51 +0000
commit698224c6c8c008d01f00d621f3d051ab7d9419af (patch)
tree77b2089405d328021bb12b2021ca08344e9ab1e6 /target/linux/ar71xx/base-files
parent503f946c66c81e31a81422b6c0a4ff646abaf2e0 (diff)
[ar71xx] add uci-defaults script to migrate vlan 0 to vlan 1 after sysupgrade on devices using the RTL8366s switch
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@22625 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/ar71xx/base-files')
-rwxr-xr-xtarget/linux/ar71xx/base-files/etc/uci-defaults/vlan-migration13
1 files changed, 13 insertions, 0 deletions
diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/vlan-migration b/target/linux/ar71xx/base-files/etc/uci-defaults/vlan-migration
new file mode 100755
index 0000000000..bea9493c8e
--- /dev/null
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/vlan-migration
@@ -0,0 +1,13 @@
+#!/bin/sh
+#
+# Copyright (C) 2010 OpenWrt.org
+#
+
+local dev="$(uci -q get network.@switch_vlan[0].device)"
+local vlan="$(uci -q get network.@switch_vlan[0].vlan)"
+
+if [ "$dev" = "rtl8366s" ] && [ "$vlan" = 0 ]; then
+ logger -t vlan-migration "VLAN 0 is invalid for RTL8366s, changing to 1"
+ uci set network.@switch_vlan[0].vlan=1
+ uci commit network
+fi