mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-02-03 20:03:25 +01:00
Add PostGIS extension check to Reitti update_script
Automatically enable PostGIS extension on existing installations if missing.
Checks if extension is already enabled before attempting to create it.
Fixes existing Reitti installations that were created before PostGIS was
added to the initial setup (commit b6312b87d).
Users no longer need to manually run 'CREATE EXTENSION postgis;'
This commit is contained in:
@@ -28,6 +28,15 @@ function update_script() {
|
||||
exit
|
||||
fi
|
||||
|
||||
# Enable PostGIS extension if not already enabled
|
||||
if systemctl is-active --quiet postgresql; then
|
||||
if ! sudo -u postgres psql -d reitti -tAc "SELECT 1 FROM pg_extension WHERE extname='postgis'" 2>/dev/null | grep -q 1; then
|
||||
msg_info "Enabling PostGIS extension"
|
||||
sudo -u postgres psql -d reitti -c "CREATE EXTENSION IF NOT EXISTS postgis;" &>/dev/null
|
||||
msg_ok "Enabled PostGIS extension"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ ! -d /var/cache/nginx/tiles ]; then
|
||||
msg_info "Installing Nginx Tile Cache"
|
||||
mkdir -p /var/cache/nginx/tiles
|
||||
|
||||
Reference in New Issue
Block a user