diff --git a/ckan/docker-entrypoint.d/00_update_who.sh b/ckan/docker-entrypoint.d/00_update_who.sh index f2884b3..7b76729 100644 --- a/ckan/docker-entrypoint.d/00_update_who.sh +++ b/ckan/docker-entrypoint.d/00_update_who.sh @@ -2,8 +2,14 @@ # Update who.ini when exists PROXY_CKAN_LOCATION echo "Update who.ini" -if [ -n "$PROXY_CKAN_LOCATION" ] && [ "$PROXY_CKAN_LOCATION" != "/" ]; then \ - sed -i "s|\${WHO_LOCATION}|$PROXY_CKAN_LOCATION|g" ${APP_DIR}/who.ini; \ - else \ - sed -i "s|\${WHO_LOCATION}|/|g" ${APP_DIR}/who.ini; \ - fi \ No newline at end of file +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