summaryrefslogtreecommitdiff
path: root/idp/shib-entrypoint.sh
diff options
context:
space:
mode:
Diffstat (limited to 'idp/shib-entrypoint.sh')
-rwxr-xr-xidp/shib-entrypoint.sh17
1 files changed, 12 insertions, 5 deletions
diff --git a/idp/shib-entrypoint.sh b/idp/shib-entrypoint.sh
index 944ea09..33d534f 100755
--- a/idp/shib-entrypoint.sh
+++ b/idp/shib-entrypoint.sh
@@ -13,6 +13,13 @@ fi
if [ -n "$IDP_SCOPE" ]; then
sed -i -e "/idp.scope=/ s/nordu.dev/$IDP_HOSTNAME/" $IDP_PROPERTIES
fi
+# log to /opt/data/logs
+if [ -e /opt/data ]; then
+ if ! grep -q "idp.logfiles=" $IDP_PROPERTIES; then
+ mkdir /opt/data/logs
+ echo "idp.logfiles=/opt/data/logs" >> $IDP_PROPERTIES
+ fi
+fi
# FTICKS
if [ -n "$FTICKS_FEDERATION" ]; then
@@ -37,7 +44,7 @@ fi
# PersistentID
if [ -n "$IDP_PERSISTENTID_SALT" ]; then
- if ! grep '<ref bean="shibboleth.SAML2PersistentGenerator" />' /opt/shibboleth-idp/conf/saml-nameid.xml ; then
+ if ! grep -q '<ref bean="shibboleth.SAML2PersistentGenerator" />' /opt/shibboleth-idp/conf/saml-nameid.xml ; then
sed -i -e '/<util:list id="shibboleth.SAML2NameIDGenerators">/ a <ref bean="shibboleth.SAML2PersistentGenerator" />' /opt/shibboleth-idp/conf/saml-nameid.xml
fi
@@ -47,13 +54,13 @@ if [ -n "$IDP_PERSISTENTID_SALT" ]; then
-e '/idp.persistentId.salt/ s/^#//' \
-e "/idp.persistentId.salt/ s/changethistosomethingrandom/$IDP_PERSISTENTID_SALT/" /opt/shibboleth-idp/conf/saml-nameid.properties
# add xml conf to attribute-resolver
- if ! grep "%{idp.persistentId.sourceAttribute}" /opt/shibboleth-idp/conf/attribute-resolver.xml ; then
+ if ! grep -q "%{idp.persistentId.sourceAttribute}" /opt/shibboleth-idp/conf/attribute-resolver.xml ; then
sed -i '/<!-- eduPersonTargetdID placeholder -->/r /opt/templates/config/edupersontargetdid.xml.add' /opt/shibboleth-idp/conf/attribute-resolver.xml
fi
fi
if [ -n "$IDP_DEBUG" ]; then
- if ! grep "idp.loglevel.messages=DEBUG" $IDP_PROPERTIES ; then
+ if ! grep -q "idp.loglevel.messages=DEBUG" $IDP_PROPERTIES ; then
echo "idp.loglevel.messages=DEBUG" >> $IDP_PROPERTIES
echo "idp.loglevel.encryption=DEBUG" >> $IDP_PROPERTIES
fi
@@ -88,7 +95,7 @@ if [ -e ${DATADIR}/sp-metadata ]; then
SP_NAME=${SP_XML%.*}
ENTITY_ID=$(grep -o 'entityID=".*"' "$sp_file" | sed -e 's/entityID="//' -e 's/".*$//')
- if ! grep "$SP_XML" /opt/shibboleth-idp/conf/metadata-providers.xml ; then
+ if ! grep -q "$SP_XML" /opt/shibboleth-idp/conf/metadata-providers.xml ; then
sed -i '/<!-- local SPs -->/r /opt/templates/config/sp.xml.add' /opt/shibboleth-idp/conf/metadata-providers.xml
sed -i -e "s/SP_NAME/$SP_NAME/" -e "s/SP_XML/$SP_XML/" /opt/shibboleth-idp/conf/metadata-providers.xml
@@ -101,7 +108,7 @@ fi
# Styling/view properties
IDP_MESSAGES=/opt/shibboleth-idp/messages/messages.properties
if [ -n "$IDP_FOOTER" ]; then
- if ! grep "idp.footer" $IDP_PROPERTIES; then
+ if ! grep -q "idp.footer" $IDP_PROPERTIES; then
echo "idp.footer=$IDP_FOOTER" >> $IDP_PROPERTIES
fi
fi