Skip to content
Snippets Groups Projects
Commit a2f23569 authored by remi-filament's avatar remi-filament
Browse files

Add check for unaccent database

parent 20808076
Branches
Tags v1.2.2
No related merge requests found
...@@ -30,13 +30,10 @@ export PGUSER=$value ...@@ -30,13 +30,10 @@ export PGUSER=$value
check_config "db_password" "$PASSWORD" check_config "db_password" "$PASSWORD"
export PGPASSWORD=$value export PGPASSWORD=$value
result="$(psql -qc 'CREATE EXTENSION IF NOT EXISTS unaccent' 2>&1)" if ! psql -l | grep $PGDATABASE; then
ok=$? echo "Database $PGDATABASE does not exist"
if [ $ok -eq 0 -a -z "$result" ]; then else
echo "INFO Unaccent extension installed" psql -qc 'CREATE EXTENSION IF NOT EXISTS unaccent'
elif [ $ok -ne 0 ]; then
echo "WARNING Attempt to install unaccent in \
$PGDATABASE@$PGHOST failed with this message: $result"
fi fi
case "$1" in case "$1" in
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment