From bcd3b3f215d04e4f0cb53a8517e62a4d5d04681a Mon Sep 17 00:00:00 2001 From: Dustin Kirkland Date: Mon, 17 Aug 2009 14:12:15 -0500 Subject: [PATCH] allow interface overrides for ip address Signed-off-by: Dustin Kirkland --- bin/ip_address | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bin/ip_address b/bin/ip_address index 9ba54f01..c7dbf4f4 100755 --- a/bin/ip_address +++ b/bin/ip_address @@ -29,7 +29,13 @@ fi [ "$hostname" = "1" ] && space=" " [ "$whoami" = "1" ] && space=" " -interface=`tail -n1 /proc/net/route | awk '{print $1}'` +# Allow interface overrides in $HOME/.$PKG/statusrc +if [ -n "$MONITORED_NETWORK" ]; then + interface="$MONITORED_NETWORK" +else + interface=`tail -n1 /proc/net/route | awk '{print $1}'` +fi + ipaddr=`/sbin/ifconfig "$interface" | grep "inet addr:" | sed "s/^.*inet addr://" | sed "s/ .*$//"` printf "%s\005{+b }%s\005{-}" "$space" "$ipaddr"