switch to using replication_url

This commit is contained in:
Greg
2021-12-20 14:00:14 +00:00
parent 630e37b4b1
commit 89d238b2d0
3 changed files with 10 additions and 5 deletions

11
openstreetmap-tiles-update-expire Normal file → Executable file
View File

@@ -110,12 +110,15 @@ if [ $# -eq 1 ] ; then
mkdir -p $WORKOSM_DIR
$OSMOSIS_BIN --read-replication-interval-init workingDirectory=$WORKOSM_DIR 1>&2 2> "$OSMOSISLOG"
init_seq=$(pyosmium-get-changes --server https://planet.openstreetmap.org/replication/minute/ -D $1)
init_seq=$(pyosmium-get-changes --server $REPLICATION_URL -D $1)
url_dynamicPart=$(printf %09d $init_seq | sed 's_\([0-9][0-9][0-9]\)\([0-9][0-9][0-9]\)\([0-9][0-9][0-9]\)_\1/\2/\3_')
wget https://planet.openstreetmap.org/replication/minute/$url_dynamicPart.state.txt -O $WORKOSM_DIR/state.txt
wget $REPLICATION_URL/$url_dynamicPart.state.txt -O $WORKOSM_DIR/state.txt
cat > /var/lib/mod_tile/.osmosis/configuration.txt <<- EOM
baseURL=$REPLICATION_URL
maxInterval=86400
EOM
mv $WORKOSM_DIR/configuration.txt $WORKOSM_DIR/configuration_orig.txt
sed "s!baseUrl=http://planet.openstreetmap.org/replication/minute!baseUrl=https://planet.openstreetmap.org/replication/minute!" $WORKOSM_DIR/configuration_orig.txt > $WORKOSM_DIR/configuration.txt
else
# make sure the lockfile is removed when we exit and then claim it