From 55f8036377e5fa3a0ed504dd072c65ebfdecd40f Mon Sep 17 00:00:00 2001 From: Dennis Camera Date: Wed, 2 Oct 2019 18:09:39 +0200 Subject: [PATCH] [explorer/interfaces] Always sort output Before, only the output of ifconfig was sorted. --- cdist/conf/explorer/interfaces | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/cdist/conf/explorer/interfaces b/cdist/conf/explorer/interfaces index 55287971..aeb55ed0 100755 --- a/cdist/conf/explorer/interfaces +++ b/cdist/conf/explorer/interfaces @@ -18,13 +18,11 @@ # along with cdist. If not, see . # -if command -v ip > /dev/null +if command -v ip >/dev/null then - ip -o link show | sed -n 's/^[0-9]\+: \(.\+\): <.*/\1/p' - -elif command -v ifconfig > /dev/null + ip -o link show | sed -n 's/^[0-9]\+: \(.\+\): <.*/\1/p' +elif command -v ifconfig >/dev/null then - ifconfig -a \ - | sed -n -E 's/^(.*)(:[[:space:]]*flags=|Link encap).*/\1/p' \ - | sort -u -fi + ifconfig -a | sed -n -E 's/^(.*)(:[[:space:]]*flags=|Link encap).*/\1/p' +fi \ + | sort -u