From 72ae0c090c0d31279bbfee14442e699e5e3bb182 Mon Sep 17 00:00:00 2001 From: Florian Pose Date: Tue, 24 Aug 2021 12:36:29 +0200 Subject: [PATCH] Removed tabs. --- script/ethercatctl.in | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/script/ethercatctl.in b/script/ethercatctl.in index 1664a31f..337d0da0 100755 --- a/script/ethercatctl.in +++ b/script/ethercatctl.in @@ -4,9 +4,7 @@ # # Start script for EtherCAT to use with systemd # -# $Id$ -# -# Copyright (C) 2006-2012 Florian Pose, Ingenieurgemeinschaft IgH +# Copyright (C) 2006-2021 Florian Pose, Ingenieurgemeinschaft IgH # # This file is part of the IgH EtherCAT Master. # @@ -62,13 +60,13 @@ parse_mac_address() { elif echo ${1} | grep -qE '^([0-9a-fA-F]{2}:){5}[0-9a-fA-F]{2}$'; then MAC=${1} else - DEVICENAMETOMAC=$("${IP}" address show dev "${1}" | awk '/link\/ether/ { print $2; }') - if echo "${DEVICENAMETOMAC}" | grep -qE '^([0-9a-fA-F]{2}:){5}[0-9a-fA-F]{2}$'; then - MAC=${DEVICENAMETOMAC} - else + DEVICENAMETOMAC=$("${IP}" address show dev "${1}" | awk '/link\/ether/ { print $2; }') + if echo "${DEVICENAMETOMAC}" | grep -qE '^([0-9a-fA-F]{2}:){5}[0-9a-fA-F]{2}$'; then + MAC=${DEVICENAMETOMAC} + else echo Invalid MAC address \""${1}"\" in ${ETHERCAT_CONFIG} exit 1 - fi + fi fi }