changed wireless interface detection. added dual band support. added all types of interfaces wl/wlan/ath
changed wireless interface detection. added dual band support. added all types of interfaces wl/wlan/ath

--- a/wifischedule/files/usr/sbin/wifi_schedule
+++ b/wifischedule/files/usr/sbin/wifi_schedule
@@ -11,13 +11,13 @@
 
 	if [ $enabledoncurrenthour == "x1" ]
 	then
-		if [ "x$(uci -q -P /var/state/ get wireless.@wifi-iface[0].up)" != "x1" ]
+		if [ ! -L /sys/devices/virtual/net/br-lan/brif/wlan0 ] && [ ! -L /sys/devices/virtual/net/br-lan/brif/wlan1 ] && [ ! -L /sys/devices/virtual/net/br-lan/brif/wl0 ] && [ ! -L /sys/devices/virtual/net/br-lan/brif/wl1 ] && [ ! -L /sys/devices/virtual/net/br-lan/brif/ath0 ] && [ ! -L /sys/devices/virtual/net/br-lan/brif/ath1 ]
 		then
 			logger "wifi_schedule: wifi is enabled $day_hour and wifi is off, turn on"
 			wifi up
 		fi
 	else
-		if [ "x$(uci -q -P /var/state/ get wireless.@wifi-iface[0].up)" == "x1" ]
+		if [ -L /sys/devices/virtual/net/br-lan/brif/wlan0 ] || [ -L /sys/devices/virtual/net/br-lan/brif/wlan1 ] || [ -L /sys/devices/virtual/net/br-lan/brif/wl0 ] || [ -L /sys/devices/virtual/net/br-lan/brif/wl1 ] || [ -L /sys/devices/virtual/net/br-lan/brif/ath0 ] || [ -L /sys/devices/virtual/net/br-lan/brif/ath1 ]
 		then
 			logger "wifi_schedule: wifi is disabled $day_hour and wifi is on, turn off"
 			wifi down
@@ -31,3 +31,4 @@
 	fi
 	sleep $timetosleep
 done
+

comments