Skip to content

Commit

Permalink
Merge pull request geoserver#61 from simonseyock/patch-1
Browse files Browse the repository at this point in the history
fix: use more slashes to make script more robust
  • Loading branch information
buehner authored Jul 18, 2024
2 parents c94bd75 + e744800 commit aeb870d
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions update_credentials.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,27 @@ if [ ${DEBUG} ]; then
fi;

# copy over default security folder to data dir (if not existing)
if [ ! -d "${GEOSERVER_DATA_DIR}security" ]; then
cp -r ${CATALINA_HOME}"/webapps/"$APP_PATH_PREFIX"geoserver/data/security" ${GEOSERVER_DATA_DIR}
if [ ! -d "${GEOSERVER_DATA_DIR}/security" ]; then
cp -r "${CATALINA_HOME}/webapps/geoserver/data/security" "${GEOSERVER_DATA_DIR}/"
fi

GEOSERVER_ADMIN_USER=${GEOSERVER_ADMIN_USER:-admin}
GEOSERVER_ADMIN_PASSWORD=${GEOSERVER_ADMIN_PASSWORD:-geoserver}

# templates to use as base for replacement
USERS_XML_ORIG=${CATALINA_HOME}"/webapps/"$APP_PATH_PREFIX"geoserver/data/security/usergroup/default/users.xml"
USERS_XML_ORIG="${CATALINA_HOME}/webapps/geoserver/data/security/usergroup/default/users.xml"
echo "USING USERS XML ORIGINAL:" $USERS_XML_ORIG
ROLES_XML_ORIG=${CATALINA_HOME}"/webapps/"$APP_PATH_PREFIX"geoserver/data/security/role/default/roles.xml"
ROLES_XML_ORIG="${CATALINA_HOME}/webapps/geoserver/data/security/role/default/roles.xml"
echo "USING ROLES XML ORIGINAL:" $ROLES_XML_ORIG

# final users.xml file GeoServer data dir
USERS_XML=${USERS_XML:-${GEOSERVER_DATA_DIR}security/usergroup/default/users.xml}
USERS_XML=${USERS_XML:-"${GEOSERVER_DATA_DIR}/security/usergroup/default/users.xml"}
echo "SETTING USERS XML:" $USERS_XML
# final roles.xml file GeoServer data dir
ROLES_XML=${ROLES_XML:-${GEOSERVER_DATA_DIR}security/role/default/roles.xml}
ROLES_XML=${ROLES_XML:-"${GEOSERVER_DATA_DIR}/security/role/default/roles.xml"}
echo "SETTING ROLES XML:" . $ROLES_XML

CLASSPATH=$CATALINA_HOME/webapps/$APP_PATH_PREFIX"geoserver/WEB-INF/lib/"
CLASSPATH="$CATALINA_HOME/webapps/geoserver/WEB-INF/lib/"

# tmp files
TMP_USERS=/tmp/users.xml
Expand Down Expand Up @@ -68,4 +68,4 @@ else
exit
fi

echo "... DONE updating GeoServer Credentials ..."
echo "... DONE updating GeoServer Credentials ..."

0 comments on commit aeb870d

Please sign in to comment.