Use shibboleth-sp as package name for compatibility.
[shibboleth/cpp-sp.git] / configs / metagen.sh
index e460240..d616b1f 100755 (executable)
@@ -1,4 +1,4 @@
-#! /bin/sh
+#!/usr/bin/env bash
 
 DECLS=1
 
@@ -23,13 +23,14 @@ SAML20PAOS="urn:oasis:names:tc:SAML:2.0:bindings:PAOS"
 SAML1POST="urn:oasis:names:tc:SAML:1.0:profiles:browser-post"
 SAML1ART="urn:oasis:names:tc:SAML:1.0:profiles:artifact-01"
 
-while getopts a:c:e:f:h:n:o:s:t:u:12ADLNO c
+while getopts a:c:e:f:h:l:n:o:s:t:u:12ADLNO c
      do
          case $c in
            c)   CERTS[${#CERTS[*]}]=$OPTARG;;
            e)   ENTITYID=$OPTARG;;
            f)   FORMATS[${#FORMATS[*]}]=$OPTARG;;
            h)   HOSTS[${#HOSTS[*]}]=$OPTARG;;
+           l)   HOSTLIST=$OPTARG;;
            n)   NAKEDHOSTS[${#NAKEDHOSTS[*]}]=$OPTARG;;
            o)   ORGNAME=$OPTARG;;
            a)   ADMIN[${#ADMIN[*]}]=$OPTARG;;
@@ -73,6 +74,18 @@ if [ -z $ENTITYID ] ; then
     fi
 fi
 
+if [ ! -z $HOSTLIST ] ; then
+    if [ -s $HOSTLIST ] ; then
+        while read h
+        do
+            HOSTS[${#HOSTS[@]}]=$h
+        done <$HOSTLIST
+    else
+        echo File with list of hostnames $l does not exist! 
+        exit 2
+    fi
+fi
+
 # Establish protocols and bindings.
 
 if [ $SAML1 -eq 0 -a $SAML2 -eq 0 ] ; then
@@ -124,11 +137,6 @@ if [ $SAML1 -eq 1 ] ; then
     fi
 fi
 
-if [ $SAML2 -eq 1 ] ; then
-    ACS[${#ACS[*]}]=$SAML20PAOS
-    ACSLOC[${#ACSLOC[*]}]="SAML2/ECP"
-fi
-
 if [ $DECLS -eq 1 ] ; then
     DECLS="xmlns:md=\"urn:oasis:names:tc:SAML:2.0:metadata\" xmlns:ds=\"http://www.w3.org/2000/09/xmldsig#\" "
     if [ $DS -eq 1 ] ; then
@@ -162,7 +170,7 @@ done
 for h in ${NAKEDHOSTS[@]}
 do
   cat << EOF
-      <disco:DiscoveryResponse xmlns="urn:oasis:names:tc:SAML:profiles:SSO:idp-discovery-protocol" Binding="urn:oasis:names:tc:SAML:profiles:SSO:idp-discovery-protocol" Location="http://$h/Shibboleth.sso/DS" index="$count"/>
+      <disco:DiscoveryResponse Binding="urn:oasis:names:tc:SAML:profiles:SSO:idp-discovery-protocol" Location="http://$h/Shibboleth.sso/DS" index="$count"/>
 EOF
   let "count++"
 done