Make functional stub function download_hpr_sql
This commit is contained in:
parent
ee6a4e601d
commit
13aeb647ad
@ -79,7 +79,37 @@ function clean_working_dir {
|
|||||||
# PARAMETERS:
|
# PARAMETERS:
|
||||||
# RETURNS:
|
# RETURNS:
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
function download_hpr_sql { echo; }
|
function download_hpr_sql {
|
||||||
|
|
||||||
|
if [[ ! -d $1 ]] || ! expr $1 : '.*/tmp.*' ;
|
||||||
|
then
|
||||||
|
echo "Please provide the temporary directory when calling this function"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
local CURL=`which curl`
|
||||||
|
local WGET=`which wget`
|
||||||
|
local HPR_URL=https://www.hackerpublicradio.org/hpr.sql
|
||||||
|
|
||||||
|
if [ -f $1/hpr.sql ];
|
||||||
|
then
|
||||||
|
echo "Removing temporary hpr.sql"
|
||||||
|
rm $1/hpr.sql
|
||||||
|
else
|
||||||
|
echo "No temporary hpr.sql found"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$CURL" != "" ];
|
||||||
|
then
|
||||||
|
curl $HPR_URL --output $1/hpr.sql
|
||||||
|
elif [ "$WGET" != "" ];
|
||||||
|
then
|
||||||
|
wget --directory-prefix=$1 $HPR_URL
|
||||||
|
else
|
||||||
|
echo "Could not download file. Please install either curl or wget."
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
#--- FUNCTION ----------------------------------------------------------------
|
#--- FUNCTION ----------------------------------------------------------------
|
||||||
# NAME: make_hpr_sqlite_db
|
# NAME: make_hpr_sqlite_db
|
||||||
|
Reference in New Issue
Block a user