The "/proc/sys/dev/$device/dev_name" is not always available.
At least it is not created in my case (madwifi 0.9.4).

Signed-off-by: Roberto Riggio <[email protected]>

--

Index: package/madwifi/files/lib/wifi/madwifi.sh
===================================================================
--- package/madwifi/files/lib/wifi/madwifi.sh   (revisione 13658)
+++ package/madwifi/files/lib/wifi/madwifi.sh   (copia locale)
@@ -174,8 +174,11 @@
                config_get anttx "$device" txantenna
                config_get_bool softled "$device" softled 1
 
-               devname="$(cat /proc/sys/dev/$device/dev_name)"
+               devname=
                antgpio=
+               [ -f "/proc/sys/dev/$device/dev_name" ] && {
+                       devname="$(cat /proc/sys/dev/$device/dev_name)"
+               }
                case "$devname" in
                        NanoStation2) antgpio=7;;
                        NanoStation5) antgpio=1;;
@@ -325,7 +328,10 @@
        [ -d ath ] || return
        for dev in $(ls -d wifi* 2>&-); do
                config_get type "$dev" type
-               devname="$(cat /proc/sys/dev/$dev/dev_name)"
+               devname=
+               [ -f "/proc/sys/dev/$device/dev_name" ] && {
+                       devname="$(cat /proc/sys/dev/$device/dev_name)"
+               }
                case "$devname" in
                        NanoStation*)
                                EXTRA_DEV="
_______________________________________________
openwrt-devel mailing list
[email protected]
http://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

Reply via email to