slitaz-base-files rev 244

Add ipinfo (to let users find local ip easily)
author Christophe Lincoln <pankso@slitaz.org>
date Wed Apr 30 13:55:46 2014 +0200 (2014-04-30)
parents a49c0a558fa7
children e970dc10e7e2
files rootfs/usr/bin/ipinfo
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/rootfs/usr/bin/ipinfo	Wed Apr 30 13:55:46 2014 +0200
     1.3 @@ -0,0 +1,15 @@
     1.4 +#!/bin/sh
     1.5 +#
     1.6 +# ipinfo: Show SliTaz local IP address 
     1.7 +#
     1.8 +. /etc/network.conf
     1.9 +
    1.10 +if [ "$WIFI" == "yes" ]; then
    1.11 +	iface="$WIFI_INTERFACE"
    1.12 +else
    1.13 +	iface="$INTERFACE"
    1.14 +fi
    1.15 +
    1.16 +ifconfig ${iface} | fgrep 'inet addr:' | cut -d ':' -f 2 | awk '{print $1}'
    1.17 +
    1.18 +exit 0