From f4047a3b647315efa8735b4feea783c8e6642a8c Mon Sep 17 00:00:00 2001 From: Jephte Clain Date: Sat, 13 Aug 2022 18:57:19 +0400 Subject: [PATCH] ipaddr: forcer la sortie couleur --- ipaddr | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ipaddr b/ipaddr index 811a16b..17c0795 100755 --- a/ipaddr +++ b/ipaddr @@ -7,7 +7,9 @@ elif [ -x /bin/ip ]; then IP=/bin/ip else IP=ip fi -tty -s <&1 && isatty=1 || isatty= +if [ -n "IPADDR_COLOR" ]; then isatty=1 +else tty -s <&1 && isatty=1 || isatty= +fi "$IP" addr "$@" | awk -v isatty="$isatty" ' isatty && $0 ~ /^[0-9]/ {