Skip to content

Commit

Permalink
Fix Shell Logic (#3183)
Browse files Browse the repository at this point in the history
* Shell logic fix to create blank_osmapidb.sql.

* Create blank_osmapidb.sql first.
  • Loading branch information
Justin Bronn authored and sputnam committed May 9, 2019
1 parent 6ab873c commit 86f88f3
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions scripts/database/SetupOsmApiDB.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ export AUTH="-h $DB_HOST_OSMAPI -p $DB_PORT_OSMAPI -U $DB_USER_OSMAPI"
export PGPASSWORD=$DB_PASSWORD_OSMAPI
do_create="true"

# there are times where this file hasn't been created yet, create it
if [ ! -e $HOOT_HOME/scripts/database/blank_osmapidb.sql ]; then
$HOOT_HOME/scripts/ReplaceEnvironmentVariables.sh $HOOT_HOME/scripts/database/blank_osmapidb.sql.in $HOOT_HOME/scripts/database/blank_osmapidb.sql
fi

# see if old db osmapi_test exists
export flag=`psql $AUTH -lqt | cut -d \| -f 1 | grep -w "^ $DB_NAME_OSMAPI \+" | wc -l`

Expand Down Expand Up @@ -40,11 +45,6 @@ if [ "$flag" = "1" ]; then
db_date_str=${db_date_str#*[}
db_date_str=${db_date_str%]*}

# there are times where this file hasn't been created yet, create it
if [ -e $HOOT_HOME/scripts/database/blank_osmapidb.sql ]; then
$HOOT_HOME/scripts/ReplaceEnvironmentVariables.sh $HOOT_HOME/scripts/database/blank_osmapidb.sql.in $HOOT_HOME/scripts/database/blank_osmapidb.sql
fi

# get sql file timestamp
file_date_str=`stat -c "%y" $HOOT_HOME/scripts/database/blank_osmapidb.sql`;

Expand Down

0 comments on commit 86f88f3

Please sign in to comment.