Hi,
while i was reading some init files i stumbled upon this:
/sbin/wifi detect >> /etc/config/wireless
grep -qs config /etc/config/wireless && {
/sbin/wifi up
} || {
rm -f /etc/config/wireless
}
this means:
> /sbin/wifi detect >> /etc/config/wireless
/sbin/wifi only outputs something if /etc/config/wireless doesnt exist
but even if the files exist /etc/config/wireless modification time gets
updated. this means even when the wifi is allready configured the modtime of
the file gets updated everytime the system boots.
i created this patch - maybe there is a better way to fix this.
diff --git a/package/base-files/files/etc/init.d/network b/package/base-files/files/etc/init.d/network
index c2095a4..906e3a3 100755
--- a/package/base-files/files/etc/init.d/network
+++ b/package/base-files/files/etc/init.d/network
@@ -9,12 +9,15 @@ boot() {
include /lib/network
setup_switch
- /sbin/wifi detect >> /etc/config/wireless
+
+ /sbin/wifi detect > /tmp/wireless.tmp
+ [ $(cat /tmp/wireless.tmp|wc -l) != 0 ] && {
+ cat /tmp/wireless.tmp >> /etc/config/wireless
+ }
grep -qs config /etc/config/wireless && {
/sbin/wifi up
- } || {
- rm -f /etc/config/wireless
}
+ rm -f /tmp/wireless.tmp
scan_interfaces
_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/mailman/listinfo/openwrt-devel