From de5ccd8a1c8e1a5689562087527712535ec73d49 Mon Sep 17 00:00:00 2001 From: inxi-svn Date: Mon, 16 Apr 2012 18:06:13 +0000 Subject: [PATCH] added feature where a different ip page can be added by whoever. That would need to be set in the inxi override config file. The page must show only one line of output, and that last item on that line must be the ip address. Ok, that's it, not a big deal, but some people may prefer a non smxi ip address page for whatever reason, so have at it. Or not. --- inxi | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/inxi b/inxi index f5d8a91..3d01876 100755 --- a/inxi +++ b/inxi @@ -1,8 +1,8 @@ #!/bin/bash ######################################################################## #### Script Name: inxi -#### version: 1.7.31 -#### Date: March 26 2012 +#### version: 1.7.32 +#### Date: April 16 2012 #### Patch Number: 00 ######################################################################## #### SPECIAL THANKS @@ -412,6 +412,9 @@ SCRIPT_DOWNLOAD_BRANCH_2='http://inxi.googlecode.com/svn/branches/two/' SCRIPT_DOWNLOAD_BRANCH_3='http://inxi.googlecode.com/svn/branches/three/' SCRIPT_DOWNLOAD_BRANCH_4='http://inxi.googlecode.com/svn/branches/four/' SCRIPT_DOWNLOAD_DEV='http://smxi.org/test/' +# note, you can use any ip url here as long as it's the only line on the output page. +# Also the ip address must be the last thing on that line. +WAN_IP_URL='http://smxi.org/opt/ip.php' KONVI_CFG="konversation/scripts/$SCRIPT_NAME.conf" # relative path to $(kde-config --path data) ### Script Localization @@ -4693,10 +4696,12 @@ get_networking_wan_ip_data() eval $LOGFS local ip='' - # get ip using wget redirect to stdout. This is a clean, text only IP output url. - ip=$( wget -q -O - http://smxi.org/opt/ip.php | gawk -F 'is: ' '{ + # get ip using wget redirect to stdout. This is a clean, text only IP output url, + # single line only, ending in the ip address. May have to modify this in the future + # to handle ipv4 and ipv6 addresses but should not be necessary. + ip=$( wget -q -O - $WAN_IP_URL | gawk '{ #gsub("\n","",$2") - print $2 + print $NF }' ) if [[ -z $ip ]];then