Added EXIT operation to abort generation on a given line.
authorSomeone <someone@somenet.org>
Thu, 5 Feb 2015 16:34:48 +0000 (17:34 +0100)
committerSomeone <someone@somenet.org>
Thu, 5 Feb 2015 16:34:48 +0000 (17:34 +0100)
certgen.data.example
certgen.sh

index 9c14e387e62ed93029875458d34780a7afd19e1c..bfe4a191562bec22be03a2d29f7b6ca474b5f308 100644 (file)
@@ -1,14 +1,25 @@
 # Certgen config file
-# Format: <SGN/CRT/CSR> <domain name> <crt-subject> <alt dns names ","-separated, NOT SPACES!>
-# SGN: use CA in ./ca to sign the new cert.
-# CRT: selfsign the new cert
-# CST: create a csr only.
-
+#
+# Empty lines or lines starting with "#" are ignored.
+#
+# Format: <OPERATION> <Parameters>
+#         EXIT <errorcode> <optional: text with spaces to display>
+#         CA   <CA Name> <Cert Subject>
+#         SGN  <CN> <Cert Subject> <optional: additional DNS-alt-names ","-separated, NOT SPACES!>
+#                 This will create a cert and sign with the ca located in ./ca/
+#         CRT  <CN> <Cert Subject> <optional: additional DNS-alt-names ","-separated, NOT SPACES!>
+#                 This will create a self signed cert.
+#         CSR  <CN> <Cert Subject> <optional: additional DNS-alt-names ","-separated, NOT SPACES!>
+#                 This will create a cert request only.
+#                 
 # For some strange reason the subject line has to start with /emailAddress=...
 # Otherwise some weird stuff happens - good job, openssl folks :/
 
 # For failing services ;)
-CRT localhost /emailAddress=root@localhost/OU=CertGen/O=YouFailed;)/
+CRT localhost /emailAddress=root@localhost/OU=CertGen/O=YouFailed;)/ *.loc,loc,l,*.l
+
+# stop certgen here
+EXIT 0 Stop processing here - comment out or delete.
 
 # Setup a CA-system
 CA SomeNet /emailAddress=contact@somenet.org/OU=CertGenCA/O=somenet.org/CN=SomeNet/ 
index 4c9a8221999a03a1d379223ecdf384a1cc5c0744..b067d56a5685d50f0cbea71cdaa6e36fe41d6314 100755 (executable)
@@ -15,6 +15,11 @@ while read cdline ; do
        cd $MYPWD
        read -a certdata <<< "$cdline"
 
+       if [[ ${certdata[0]} == "EXIT" ]] ; then
+               echo "*** $cdline ***" 1>&2
+               exit ${certdata[1]}
+       fi
+
        echo "*** Processing: $(date -Iseconds) - ${certdata[0]} - ${certdata[1]} ***"
        if [[ -d "output/${certdata[1]}"  ]] ; then
                echo "*** ERROR - THIS SEEMS TO ALREADY EXIST ***" 1>&2