From 06bae0e38eb54f519c2cfa27c5bae9277e1de2f9 Mon Sep 17 00:00:00 2001 From: inxi-svn Date: Sat, 7 May 2011 04:42:10 +0000 Subject: [PATCH] many bug fixes, the -Nc flag was just not reliable enough to use --- inxi | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/inxi b/inxi index 369c2c8..3fa1a94 100755 --- a/inxi +++ b/inxi @@ -1,7 +1,7 @@ #!/bin/bash ######################################################################## #### Script Name: inxi -#### version: 1.4.97 +#### version: 1.4.98 #### Date: May 6 2011 ######################################################################## #### SPECIAL THANKS @@ -1231,7 +1231,7 @@ script_self_updater() debug_data_collector() { - local xiin_app='' xiin_data_file='' + local xiin_app='' xiin_data_file='' xiin_download='' local xiin_data_dir="xiin-$(hostname | tr ' ' '-' | tr '[A-Z]' '[a-z]' )-$(date +%Y%m%d)" if [[ $B_RUNNING_IN_SHELL == 'true' ]];then @@ -1255,11 +1255,18 @@ debug_data_collector() xiin_data_file=$SCRIPT_DATA_DIR/$xiin_data_dir/xiin-sys.txt echo 'Downloading required tree traverse tool xiin...' - wget -q -Nc http://inxi.googlecode.com/svn/branches/xiin/xiin + # -Nc is creating really weird download anomolies, so using -O instead + xiin_download="$( wget -q -O - http://inxi.googlecode.com/svn/branches/xiin/xiin )" # if nothing got downloaded kick out error, otherwise we'll use an older version if [[ $? -gt 0 && ! -f xiin ]];then error_handler 17 'xiin' - elif [[ -n $( grep -s 'checkPython' xiin ) ]];then + elif [[ -n $( grep -s 'checkPython' <<< "$xiin_download" ) || -f xiin ]];then + if [[ -n $( grep -s 'checkPython' <<< "$xiin_download" ) ]];then + echo 'Updating xiin from remote location' + echo "$xiin_download" > xiin + else + echo 'Using local xiin due to download failure' + fi echo 'Running xiin tool now on /sys...' python ./xiin -d /sys -f $xiin_data_file if [[ $? -ne 0 ]];then