mirror of
https://github.com/dustinkirkland/byobu
synced 2025-08-22 14:24:39 -07:00
allow interface overrides for ip address
Signed-off-by: Dustin Kirkland <kirkland@canonical.com>
This commit is contained in:
parent
770f070a94
commit
bcd3b3f215
1 changed files with 7 additions and 1 deletions
|
@ -29,7 +29,13 @@ fi
|
||||||
[ "$hostname" = "1" ] && space=" "
|
[ "$hostname" = "1" ] && space=" "
|
||||||
[ "$whoami" = "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/ .*$//"`
|
ipaddr=`/sbin/ifconfig "$interface" | grep "inet addr:" | sed "s/^.*inet addr://" | sed "s/ .*$//"`
|
||||||
|
|
||||||
printf "%s\005{+b }%s\005{-}" "$space" "$ipaddr"
|
printf "%s\005{+b }%s\005{-}" "$space" "$ipaddr"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue