Changeset - a65c61ffaaef
[Not reviewed]
default
0 1 0
Dennis Fink - 7 years ago 2013-03-02 00:03:51
the_metalgamer@hackerspace.lu
Check if enough parameters are supplied to download function
1 file changed with 19 insertions and 14 deletions:
yaah
19
14
0 comments (0 inline, 0 general)
yaah
Show inline comments
...
 
@@ -229,22 +229,27 @@ extract_and_remove () {
 

	
 
download () {
 

	
 
    until [[ -z "$1" ]]; do
 
        local start=${1::2}
 
        local filename="${1}.tar.gz"
 
    if [[ $# -ne 0 ]]; then
 
        until [[ -z "$1" ]]; do
 
            local start=${1::2}
 
            local filename="${1}.tar.gz"
 

	
 
        msg "Downloading '$filename' to '$downloaddir'"
 
        curl -s -fL -o "$downloaddir/$filename" \
 
            "${AURURL}packages/$start/$1/$filename"
 
            msg "Downloading '$filename' to '$downloaddir'"
 
            curl -s -fL -o "$downloaddir/$filename" \
 
                "${AURURL}packages/$start/$1/$filename"
 

	
 
        if [[ $? -eq 0 ]]; then
 
            extract_and_remove "$downloaddir/$filename"
 
        else
 
            error "'$1' could not be found!"
 
            return 1
 
        fi
 
        shift
 
    done
 
            if [[ $? -eq 0 ]]; then
 
                extract_and_remove "$downloaddir/$filename"
 
            else
 
                error "'$1' could not be found!"
 
                return 1
 
            fi
 
            shift
 
        done
 
    else
 
        error "Not enough parameters supplied!"
 
        return 1
 
    fi
 

	
 
}
 

	
0 comments (0 inline, 0 general)