2023-04-13 14:10:40 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
2023-07-26 10:25:03 +02:00
|
|
|
# Update who.ini when exists PROXY_CKAN_LOCATION
|
2024-02-21 09:16:47 +01:00
|
|
|
echo "[docker-entrypoint.00_update_who] Update who.ini"
|
2023-07-26 12:02:40 +02:00
|
|
|
if [ -n "$PROXY_CKAN_LOCATION" ] && [ "$PROXY_CKAN_LOCATION" != "/" ]; then
|
|
|
|
sed -i "s|\${WHO_LOCATION}|$PROXY_CKAN_LOCATION|g" "${APP_DIR}/who.ini";
|
|
|
|
else
|
|
|
|
# Check if the value is exactly "/"
|
|
|
|
if [ "$PROXY_CKAN_LOCATION" = "/" ]; then
|
|
|
|
sed -i "s|\${WHO_LOCATION}||g" "${APP_DIR}/who.ini";
|
|
|
|
else
|
|
|
|
# Handle the case when $PROXY_CKAN_LOCATION is empty or not set
|
|
|
|
sed -i "s|\${WHO_LOCATION}|/|g" "${APP_DIR}/who.ini";
|
|
|
|
fi
|
|
|
|
fi
|