The mtd_get_mac_ascii utility function was broken. This fixes it.

Signed-off-by: Daniel Gimpelevich <dan...@gimpelevich.san-francisco.ca.us>
Index: package/base-files/files/lib/functions.sh
===================================================================
--- a/package/base-files/files/lib/functions.sh (revision 38679)
+++ b/package/base-files/files/lib/functions.sh (working copy)
@@ -248,15 +248,13 @@
        local part
        local mac_dirty
 
-       . /lib/functions.sh
-
        part=$(find_mtd_part "$mtdname")
        if [ -z "$part" ]; then
                echo "mtd_get_mac_ascii: partition $mtdname not found!" >&2
                return
        fi
 
-       mac_dirty=$(strings "$part" | sed -n 's/'"$key"'=//p')
+       mac_dirty=$(strings "$part" | sed -n 's/^'"$key"'=//p')
        # "canonicalize" mac
        printf "%02x:%02x:%02x:%02x:%02x:%02x" 0x${mac_dirty//:/ 0x}
 }
_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

Reply via email to