From 0f9d0fe91100c06611b1f97e6b629d459817d34d Mon Sep 17 00:00:00 2001 From: inxi-svn Date: Mon, 27 Jun 2011 18:40:42 +0000 Subject: [PATCH] added debugging option -! ftp. just so it's not restricted to ftp.techpatterns.com --- inxi | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/inxi b/inxi index 2e4e737..2ff49ff 100755 --- a/inxi +++ b/inxi @@ -1,9 +1,9 @@ #!/bin/bash ######################################################################## #### Script Name: inxi -#### version: 1.7.12 -#### Date: June 25 2011 -#### Patch Number: 06 +#### version: 1.7.13 +#### Date: June 26 2011 +#### Patch Number: 00 ######################################################################## #### SPECIAL THANKS ######################################################################## @@ -386,6 +386,7 @@ SEP2=' ' ### Script names/paths - must be non root writable SCRIPT_DATA_DIR="$HOME/.inxi" +ALTERNATE_FTP='' # for data uploads LOG_FILE="$SCRIPT_DATA_DIR/inxi.log" LOG_FILE_1="$SCRIPT_DATA_DIR/inxi.1.log" LOG_FILE_2="$SCRIPT_DATA_DIR/inxi.2.log" @@ -1246,9 +1247,13 @@ debug_data_collector() { local xiin_app='' xiin_data_file='' xiin_download='' error='' b_run_xiin='false' local debug_data_dir="inxi-$(tr ' ' '-' <<< $HOSTNAME | tr '[A-Z]' '[a-z]' )-$1-$(date +%Y%m%d)" - local completed_gz_file='' xiin_file='xiin.py' + local completed_gz_file='' xiin_file='xiin.py' ftp_upload='ftp.techpatterns.com/incoming' + local Line='-------------------------' if [[ $B_RUNNING_IN_SHELL == 'true' ]];then + if [[ -n $ALTERNATE_FTP ]];then + ftp_upload=$ALTERNATE_FTP + fi echo "Starting debugging data collection type: $1" echo -n "Checking/creating required directories... " if [[ ! -d $SCRIPT_DATA_DIR ]];then @@ -1314,6 +1319,7 @@ debug_data_collector() ifconfig &> $debug_data_dir/ifconfig.txt ip addr &> $debug_data_dir/ip-addr.txt if [[ $b_run_xiin == 'true' ]];then + echo $Line echo "Running $xiin_file tool now on /sys..." python ./$xiin_file -d /sys -f $xiin_data_file if [[ $? -ne 0 ]];then @@ -1323,6 +1329,7 @@ debug_data_collector() rm -f $xiin_data_file echo "$xiin_file data generation failed with python error $error" >> $debug_data_dir/xiin-error.txt fi + echo $Line fi fi if [[ $1 == 'xorg' || $1 == 'all' ]];then @@ -1388,9 +1395,9 @@ debug_data_collector() rm -f $debug_data_dir.tar.gz fi echo 'Creating tar.gz compressed file of this material now. Contents:' - echo '-------------------------' + echo $Line tar -cvzf $debug_data_dir.tar.gz $debug_data_dir - echo '-------------------------' + echo $Line echo 'Cleaning up leftovers...' rm -rf $debug_data_dir echo 'Testing gzip file integrity...' @@ -1404,11 +1411,13 @@ debug_data_collector() completed_gz_file=$SCRIPT_DATA_DIR/$debug_data_dir.tar.gz echo $completed_gz_file if [[ $B_UPLOAD_DEBUG_DATA == 'true' ]];then + echo $Line if [[ $b_run_xiin == 'true' ]];then - echo 'Running automatic upload of data to remote server ftp.techpatterns.com/incoming now...' + echo "Running automatic upload of data to remote server $ftp_upload now..." python ./$xiin_file --version - python ./$xiin_file -u $completed_gz_file ftp.techpatterns.com/incoming + python ./$xiin_file -u $completed_gz_file $ftp_upload if [[ $? -gt 0 ]];then + echo $Line echo "Error: looks like the ftp upload failed. Error number: $?" echo "The ftp upload failed. Error number: $?" >> $debug_data_dir/xiin-error.txt fi @@ -2025,6 +2034,9 @@ get_parameters() 14) script_self_updater "$SCRIPT_DOWNLOAD_BRANCH_4" 'svn: branch four server' ;; + ftp*) + ALTERNATE_FTP="$OPTARG" + ;; http*) script_self_updater "$OPTARG" 'alt server' ;; @@ -2181,6 +2193,7 @@ show_options() print_screen_output "-! 13 - Triggers an update from svn branch three - if present, of course." print_screen_output "-! 14 - Triggers an update from svn branch four - if present, of course." print_screen_output "-! - Triggers an update from whatever server you list." + print_screen_output "-! - Changes debugging data ftp upload location to whatever you enter here." print_screen_output " " fi print_screen_output " "