From 30f749bc6d7845fe429d9c24ff835335edba4965 Mon Sep 17 00:00:00 2001 From: inxi-svn Date: Thu, 13 Nov 2008 02:18:33 +0000 Subject: [PATCH] (Change Version) Cleaned up and refactored download error handling, put it all in download function, out of get_params, which should only set params, not execute special case code blocks. Sorry cathbard ;-) --- inxi | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/inxi b/inxi index e927f71..122da4f 100755 --- a/inxi +++ b/inxi @@ -1,7 +1,7 @@ #!/bin/bash ######################################################################## #### Script Name: inxi -#### version: 0.5.21 +#### version: 0.5.22 #### Date: November 11 2008 ######################################################################## #### inxi is a fork of infobash, the original bash sys info script by locsmif @@ -600,13 +600,7 @@ get_parameters() 4) script_self_updater "$SCRIPT_DOWNLOAD_BRANCH_2" 'svn: branch two server' ;; http*) - # first test provided url to avoid overwriting file with null - wget -q --spider "$OPTARG$SCRIPT_NAME" - if [[ $? -eq 0 ]];then - script_self_updater "$OPTARG" 'alt server' - else - error_handler 10 "$OPTARG" - fi + script_self_updater "$OPTARG" 'alt server' ;; *) error_handler 11 "$OPTARG" ;; @@ -723,6 +717,8 @@ script_self_updater() else if [[ $2 == 'svn server' ]];then error_handler 8 "$?" + elif [[ $2 == 'alt server' ]];then + error_handler 10 "$OPTARG" else error_handler 12 "$1" fi