From db5339ec8b6f1e6a2fe90235ebde1bb33d133809 Mon Sep 17 00:00:00 2001 From: Dustin Kirkland Date: Thu, 24 Jun 2010 11:13:28 -0500 Subject: [PATCH] usr/lib/byobu/ip_address --- debian/changelog | 1 + usr/lib/byobu/ip_address | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 41958c6f..6c390975 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,6 +3,7 @@ byobu (2.81) unreleased; urgency=low * Save some forks: - usr/bin/byobu-status - usr/lib/byobu/custom + - usr/lib/byobu/ip_address - usr/lib/byobu/release - usr/lib/services - usr/bin/byobu-status-detail diff --git a/usr/lib/byobu/ip_address b/usr/lib/byobu/ip_address index 95586038..6c021f12 100755 --- a/usr/lib/byobu/ip_address +++ b/usr/lib/byobu/ip_address @@ -21,7 +21,7 @@ PKG="byobu" color 2>/dev/null || color() { true; } if [ "$1" = "--detail" ]; then - LC_ALL=C /sbin/ifconfig | grep "inet addr" | sed -e 's/^\s*//' -e 's/\s*$//' + /sbin/ifconfig exit 0 fi @@ -36,6 +36,8 @@ else interface=`tail -n1 /proc/net/route | awk '{print $1}'` fi -ipaddr=`LC_ALL=C /sbin/ifconfig "$interface" | grep "inet addr:" | sed -e "s/^.*inet addr://" -e "s/ .*$//"` +ipaddr=$(LC_ALL=C /sbin/ifconfig "$interface") +ipaddr=${ipaddr#* inet addr:} +ipaddr=${ipaddr%% *} printf "%s$(color bold2)%s$(color -)" "$space" "$ipaddr"