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]/ {