From e853fed8ff5963e07401c6625191262783eac06d Mon Sep 17 00:00:00 2001 From: inxi-svn Date: Fri, 21 Nov 2008 19:51:00 +0000 Subject: [PATCH] added more browsers to ip test --- inxi | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/inxi b/inxi index b235977..9f3d016 100755 --- a/inxi +++ b/inxi @@ -1,7 +1,7 @@ #!/bin/bash ######################################################################## #### Script Name: inxi -#### version: 0.6.0-b1-t8 +#### version: 0.6.0-b1-t9 #### Date: November 20 2008 ######################################################################## #### inxi is a fork of infobash 3.02, the original bash sys info script by locsmif @@ -1789,17 +1789,20 @@ get_networking_data() get_networking_wan_ip_data() { - local extras_data='' ip='' browser='' + local extras_data='' ip='' use_browser='' browser='' + local browsers='elinks links links2 lynx w3m' - # first find a client to use: - if [[ -n $( which lynx ) ]];then - browser='lynx' - elif [[ -n $( which links2 ) ]];then - browser='links2' - fi + # first find a browser to use, these all support -dump + for browser in $browsers + do + if [[ -n $( which $browser ) ]];then + use_browser=$browser + break + fi + done - if [[ -n $browser ]];then - ip=$( $browser -dump techpatterns.com/ip | awk -F 'is: ' '{ + if [[ -n $use_browser ]];then + ip=$( $use_browser -dump techpatterns.com/ip | awk -F 'is: ' '{ #gsub("\n","",$2") print $2 }' )