diff options
Diffstat (limited to 'package/ramips/drivers/mt7615e/files/mt7615e.inc')
-rwxr-xr-x | package/ramips/drivers/mt7615e/files/mt7615e.inc | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/package/ramips/drivers/mt7615e/files/mt7615e.inc b/package/ramips/drivers/mt7615e/files/mt7615e.inc new file mode 100755 index 0000000..783191d --- /dev/null +++ b/package/ramips/drivers/mt7615e/files/mt7615e.inc @@ -0,0 +1,45 @@ +#!/bin/sh +# this file will be included into mt7615e2.sh and mt7615e5.sh + +disable_mt7615e() { + cd /sys/class/net/ + + # disable apcli interfaces + for vif in apcli*; do + ifconfig $vif down; + done + # disable ap interfaces + for vif in ra*; do + ifconfig $vif down; + ubus call network.interface.lan remove_device "{\"name\":\"$vif\"}" + done + + cd - +} + + +enable_mt7615e() { + cd /sys/class/net/ + uci2dat -d mt7615e2 -f /etc/wireless/mt7615e/mt7615e.1.2G.dat > /tmp/uci2dat.log + uci2dat -d mt7615e5 -f /etc/wireless/mt7615e/mt7615e.1.5G.dat >> /tmp/uci2dat.log + + ifconfig ra0 up # ra0 is the root vif + + # enable ap interfaces + for vif in ra*; do + ifconfig $vif up; + ubus call network.interface.lan add_device "{\"name\":\"$vif\"}" + local tmp=$(brctl show | grep $vif) + if [ x"$tmp" == x"" ] + then + echo "add $vif to br-lan" >> /tmp/wifi.log + brctl addif br-lan $vif + fi + done + + # enable apcli interfaces + for vif in apcli*; do + ifconfig $vif up; + done + cd - +}
\ No newline at end of file |