Archived
4
2

Compare commits

..

No commits in common. "d789c8e1b074138934a8b7b8a203ec3eab2ff522" and "d45ca0de968260870149d6fa92a932f8f34629ba" have entirely different histories.

2 changed files with 11 additions and 32 deletions

View File

@ -2,15 +2,10 @@
# with the database. # with the database.
# dbi:<driver name [SQLite, CSV, ADO, mSQL, etc.]>:<database name> # dbi:<driver name [SQLite, CSV, ADO, mSQL, etc.]>:<database name>
[DBI] [DBI]
# Configuration for SQLite (uncomment following settings) database: mysql
#driver: dbi:SQLite:hpr.db driver: dbi:mysql:database=hpr_hpr:hostname=localhost
#user: (unused -- leave blank) user: hpr-generator
#password: (unused -- leave blank) password: zBozqN-Z2zNAz
# Configuration for MySQL (uncomment and update following settings)
#database: mysql
#driver: dbi:mysql:database=hpr_hpr:hostname=localhost
#user: hpr-generator (suggested user with read only permissions)
#password: ********* (password created for user)
# Configure the root template page which pulls in the navigation and # Configure the root template page which pulls in the navigation and
# content templates used by each page. An optional baseurl property may # content templates used by each page. An optional baseurl property may

View File

@ -42,15 +42,12 @@ set -o nounset # Treat unset variables as an error
# RETURNS: The path to the working directory # RETURNS: The path to the working directory
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
function make_working_dir { function make_working_dir {
# the directory of the script # the directory of the script
local DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# the temp directory used, within $DIR # the temp directory used, within $DIR
# omit the -p parameter to create a temporal directory in # omit the -p parameter to create a temporal directory in the default location
# the default location WORK_DIR=`mktemp -d -p "$DIR"`
local WORK_DIR=`mktemp -d -p "$DIR"`
# check if tmp dir was created # check if tmp dir was created
if [[ ! "$WORK_DIR" || ! -d "$WORK_DIR" ]]; then if [[ ! "$WORK_DIR" || ! -d "$WORK_DIR" ]]; then
@ -58,7 +55,7 @@ function make_working_dir {
exit 1 exit 1
fi fi
echo $WORK_DIR echo $WORK_DIR
} }
#--- FUNCTION ---------------------------------------------------------------- #--- FUNCTION ----------------------------------------------------------------
# NAME: clean_working_dir # NAME: clean_working_dir
@ -67,13 +64,11 @@ function make_working_dir {
# RETURNS: # RETURNS:
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
function clean_working_dir { function clean_working_dir {
if [[ -d $1 ]] && expr $1 : '.*/tmp.*' ; then if [[ -d $1 ]] && expr $1 : '.*/tmp.*' ; then
rm -rf $1 rm -rf $1
echo "Deleted temp working directory $1" echo "Deleted temp working directory $1"
else else
echo "Did not delete directory: $1" echo "Not a temporary directory: $1"
echo "Not a temporary directory."
fi fi
} }
@ -101,17 +96,15 @@ function download_hpr_sql {
echo "Removing temporary hpr.sql" echo "Removing temporary hpr.sql"
rm $1/hpr.sql rm $1/hpr.sql
else else
echo "No temporary hpr.sql to remove" echo "No temporary hpr.sql found"
fi fi
if [ "$CURL" != "" ]; if [ "$CURL" != "" ];
then then
curl $HPR_URL --output $1/hpr.sql curl $HPR_URL --output $1/hpr.sql
echo "Downloaded hpr.sql via curl"
elif [ "$WGET" != "" ]; elif [ "$WGET" != "" ];
then then
wget --directory-prefix=$1 $HPR_URL wget --directory-prefix=$1 $HPR_URL
echo "Downloaded hpr.sql via wget"
else else
echo "Could not download file. Please install either curl or wget." echo "Could not download file. Please install either curl or wget."
return 1 return 1
@ -171,14 +164,5 @@ function make_hpr_sqlite_db {
# PARAMETERS: # PARAMETERS:
# RETURNS: # RETURNS:
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
function copy_to_public_dir { function copy_to_public_dir { echo; }
if [ $# -gt 1 ] && [ ! -z "$1" ] && [ ! -z "$2" ];
then
cp $1/hpr.sql $2/hpr.sql
cp $1/hpr.db $2/hpr.db
return 0
else
echo "Bad arguments. Can't copy files to public directory."
fi
}