(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 ;-)
This commit is contained in:
inxi-svn 2008-11-13 02:18:33 +00:00
parent c848609967
commit 30f749bc6d

10
inxi
View file

@ -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
;;
*) 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