From 902da9f837e9273a2166b0f4b1094b8f5587a5e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Pierret=20=28fepitre=29?= Date: Sat, 18 May 2019 10:42:13 +0200 Subject: [PATCH] Handle default value for get_iface_from_mac --- init/functions | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/init/functions b/init/functions index 29573a7..4ed27e6 100644 --- a/init/functions +++ b/init/functions @@ -131,7 +131,9 @@ umount_retry() { get_iface_from_mac() { local mac="$1" local iface - iface="$(ip -o link | grep -i "$mac" | awk '{print $2}' | cut -d ':' -f1)" + if [ "x$mac" != "x" ]; then + iface="$(ip -o link | grep -i "$mac" | awk '{print $2}' | cut -d ':' -f1)" + fi echo "$iface" }