View Single Post
No!No!No!Yes!'s Avatar
Posts: 700 | Thanked: 846 times | Joined on Nov 2009
#88
Originally Posted by zimon View Post
About "Internal IP" command. Would it be possible somehow to colorize differently address which has default route (out to Internet)?
Code:
# ifconfig;route
bnep0     Link encap:Ethernet  HWaddr EC:9B:5B:D3:XX:XX  
          inet addr:192.168.3.15  Bcast:192.168.3.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2720 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2128 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:397510 (388.1 KiB)  TX bytes:356735 (348.3 KiB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:60 errors:0 dropped:0 overruns:0 frame:0
          TX packets:60 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:3016 (2.9 KiB)  TX bytes:3016 (2.9 KiB)

phonet0   Link encap:UNSPEC  HWaddr 15-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  
          UP POINTOPOINT RUNNING NOARP  MTU:4000  Metric:1
          RX packets:345 errors:0 dropped:0 overruns:0 frame:0
          TX packets:160 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:100 
          RX bytes:8444 (8.2 KiB)  TX bytes:5422 (5.2 KiB)

usb0      Link encap:Ethernet  HWaddr C6:B2:5D:9E:YY:YY  
          inet addr:192.168.2.15  Bcast:192.168.2.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.3.0     *               255.255.255.0   U     0      0        0 bnep0
192.168.2.0     *               255.255.255.0   U     0      0        0 usb0
default         bt              0.0.0.0         UG    0      0        0 bnep0
In this case 192.168.3.15
Yes, it is.

As long as you can write logic to parse the output, with awk/sed/etc. and programmatically isolate the ipaddress ... you can stick Pango Markup Language around it:

PHP Code:
echo "<span foreground=\"green\"><big><i>IP_ADDRESS_GOES_HERE</i></big></span>" 
And it will be shown with all the bells & wistles you like
__________________
Have a look at Queen BeeCon Widget (WIKI) Customizable and flexible widget-based multi-instance monitoring, alerting and interactive tool for the N900
Please provide comments and feedback for having QBW supported and enhanced further - (DONATE) - v1.3.3devel / v1.3.3testing / v1.3.3extras
 

The Following User Says Thank You to No!No!No!Yes! For This Useful Post: