#!/bin/bash
# GeoServer安装配置脚本
echo "开始配置GeoServer..."
# 创建工作空间
curl -u admin:geoserver -X POST -H "Content-type: text/xml" \
-d "water_management" \
http://localhost:8080/geoserver/rest/workspaces
# 创建数据存储
curl -u admin:geoserver -X POST -H "Content-type: text/xml" \
-d "postgres_water_managementlocalhost5432water_managementpostgrespostgrespostgispublic" \
http://localhost:8080/geoserver/rest/workspaces/water_management/datastores
# 发布图层
curl -u admin:geoserver -X POST -H "Content-type: text/xml" \
-d "iot_deviceiot_devicevector" \
http://localhost:8080/geoserver/rest/workspaces/water_management/layers
curl -u admin:geoserver -X POST -H "Content-type: text/xml" \
-d "water_pipe_networkwater_pipe_networkvector" \
http://localhost:8080/geoserver/rest/workspaces/water_management/layers
echo "GeoServer配置完成"