From 8a3cd3db1d3ec28d505ffbcb6d48ee2b6536a4a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Fri, 4 Dec 2020 03:23:18 +0100 Subject: [PATCH] Make init/functions suitable for running with 'set -u' Initialize local variables. --- init/functions | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/init/functions b/init/functions index 2582b4d..b9c44c4 100644 --- a/init/functions +++ b/init/functions @@ -118,7 +118,7 @@ umount_retry() { get_mac_from_iface() { local iface="$1" - local mac + local mac= if [ "x$iface" != "x" ] && [ -e "/sys/class/net/$iface" ]; then mac="$(cat "/sys/class/net/$iface/address")" fi @@ -127,7 +127,7 @@ get_mac_from_iface() { get_iface_from_mac() { local mac="$1" - local iface + local iface= if [ "x$mac" != "x" ]; then iface="$(ip -o link | grep -i "$mac" | awk '{print $2}' | cut -d ':' -f1)" fi