base-files: Really check path in get_mac_binary
authorAdrian Schmutzler <freifunk@adrianschmutzler.de>
Thu, 4 Jul 2019 21:28:44 +0000 (23:28 +0200)
committerChristian Lamparter <chunkeey@gmail.com>
Sun, 7 Jul 2019 11:02:05 +0000 (13:02 +0200)
Currently, path argument is only checked for being not empty.

This changes behavior to actually check whether path exists.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
package/base-files/files/lib/functions/system.sh

index 7ed62804a081fcd799188e185e00e48f79dfbdac..df671465beaf79cf8513d49923e4f6a749e05b52 100644 (file)
@@ -4,7 +4,7 @@ get_mac_binary() {
        local path="$1"
        local offset="$2"
 
-       if [ -z "$path" ]; then
+       if [ -e "$path" ]; then
                echo "get_mac_binary: file $path not found!" >&2
                return
        fi