Hi, thumbs up for catching this. In my opinion it doesn't matter how often the device is booted, because its possible that this is not the only occurence where writing to the flash was not necessary. So the less write access we have, the better it is.
As a suggestion, 'help test' shows that an not-empty file can be testet with the switch [ -s filename ] - so the workaround with 'wc -l' is not necessary. But I don't know if all these switches are implemented/enabled in the busybox shell. Otherwise you can just redirect the output of 'wifi detect' to a shell variable and easily test if this var is empty [ "x$OUTPUT" = "x" ] (or use -z as test-switch). Bye, Sven On 05/31/2011 10:03 AM, Alexander Gordeev wrote: > В Mon, 30 May 2011 18:38:00 -0700 > Philip Prindeville <philipp_s...@redfish-solutions.com> пишет: > >> How often are you booting that this is even a concern? > > Once or twice per day is enough? > I have a small router with a battery and USB port which you can plug > any USB 3g/4g modem in. It's quite handy to bring it with you and turn > on/off only when you need it. > >> On 5/30/11 4:00 PM, Peter Wagner wrote: >>> 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. _______________________________________________ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel