Update run.sh
Work in progress
This commit is contained in:
parent
8db3745ae7
commit
f415088e21
24
run.sh
24
run.sh
@ -13,9 +13,10 @@ function setPostgresPassword() {
|
||||
}
|
||||
|
||||
if [ "$#" -ne 1 ]; then
|
||||
echo "usage: <import|run>"
|
||||
echo "usage: <import|upgrade|run>"
|
||||
echo "commands:"
|
||||
echo " import: Set up the database and import /data.osm.pbf"
|
||||
écho ". upgrade: Upgrade the database
|
||||
echo " run: Runs Apache and renderd to serve tiles at /tile/{z}/{x}/{y}.png"
|
||||
echo "environment variables:"
|
||||
echo " THREADS: defines number of threads used for importing / tile rendering"
|
||||
@ -92,6 +93,27 @@ if [ "$1" = "import" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ "$1" = "upgrade" ]; then
|
||||
|
||||
# Ensure that database directory is in right state
|
||||
chown postgres:postgres -R /var/lib/postgresql
|
||||
if [ ! -f /var/lib/postgresql/13/main/PG_VERSION ]; then
|
||||
sudo -u postgres /usr/lib/postgresql/13/bin/pg_ctl -D /var/lib/postgresql/13/main/ initdb -o "--locale C.UTF-8"
|
||||
fi
|
||||
|
||||
# Initialize PostgreSQL
|
||||
createPostgresConfig
|
||||
service postgresql start
|
||||
|
||||
|
||||
|
||||
|
||||
service postgresql stop
|
||||
|
||||
exit 0
|
||||
|
||||
fi
|
||||
|
||||
if [ "$1" = "run" ]; then
|
||||
# Clean /tmp
|
||||
rm -rf /tmp/*
|
||||
|
||||
Loading…
Reference in New Issue
Block a user