many bug fixes, the -Nc flag was just not reliable enough to use

This commit is contained in:
inxi-svn 2011-05-07 04:42:10 +00:00
parent 9977c4b935
commit 06bae0e38e

15
inxi
View file

@ -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