Ignore:
Timestamp:
10/15/18 18:45:13 (6 years ago)
Author:
jdquinn
Message:

CHG: Added header documentation and silent flags to get commands to bash external package download script; modified Dakota install config

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/scripts/download_external_package.bash

    r23418 r23426  
    11#!/bin/bash
    22#
     3# download_external_package.bash
     4# Generally, used to download a hosted file from a URL
     5# URL - Location of file to download
     6# file - File to write to (including path)
     7# usage: download_external_package.bash URL file
    38
    49## Constants
    510#
    6 ERR_NO_GET_CMD="No supported file download command was found"
    7 ERR_NUM_ARGS="Illegal number of args"
    8 ERR_USAGE=""
     11MSG_ERR_NO_GET_CMD="No supported file download command was found"
     12MSG_USAGE="usage: $(basename ${0}) [-h] URL file
     13  URL  : Location of file to download
     14  file : File to write to (including path)"
    915
    1016## Variables
     
    1319URL=""
    1420
    15 ## Check number of args
     21## Check that number of args is 2 (note that this also handles case where user
     22#       explicitly requests help)
    1623#
    1724if [ $# != 2 ]
    1825then
    19         echo $ERR_NUM_ARGS
     26        echo "$MSG_USAGE"
     27        exit 0
    2028fi
    2129
     
    3745if [ ! -z `which wget` ]
    3846then
    39         wget --no-check-certificate -O $OUT_FILE $URL
     47        wget --quiet -O $OUT_FILE $URL
    4048elif [ ! -z `which curl` ]
    4149then
    42         curl $URL -o $OUT_FILE
     50        curl --silent $URL -o $OUT_FILE
    4351else
    44         echo $ERR_NO_GET_CMD
     52        echo $MSG_ERR_NO_GET_CMD
    4553        exit 0
    4654fi
Note: See TracChangeset for help on using the changeset viewer.