15 lines
506 B
Bash
15 lines
506 B
Bash
#!/bin/bash
|
|||
|
|
# GeoServer 初始化脚本:创建工作区、数据源、图层
|
||
|
|
set -e
|
||
|
|
GEOSERVER_URL="http://localhost:8081/geoserver"
|
||
|
|
USER="admin"
|
||
|
|
PASS="geoserver"
|
||
|
|
|
||
|
|
echo "Waiting for GeoServer..."
|
||
|
|
until curl -s -u $USER:$PASS "$GEOSERVER_URL/rest/about/version.xml" > /dev/null; do sleep 2; done
|
||
|
|
|
||
|
|
# Create workspace
|
||
|
|
curl -s -u $USER:$PASS -X POST "$GEOSERVER_URL/rest/workspaces" -H "Content-Type: text/xml" -d '<workspace><name>water_management</name></workspace>' || true
|
||
|
|
|
||
|
|
echo "GeoServer init done"
|