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>
Fri, 5 Jul 2019 20:30:46 +0000 (22:30 +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 7ed6280..df67146 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