From 806cd96028e15f6d283372f42822758a8e33d684 Mon Sep 17 00:00:00 2001 From: Someone Date: Thu, 5 Feb 2015 17:34:48 +0100 Subject: [PATCH] Added EXIT operation to abort generation on a given line. --- certgen.data.example | 23 +++++++++++++++++------ certgen.sh | 5 +++++ 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/certgen.data.example b/certgen.data.example index 9c14e38..bfe4a19 100644 --- a/certgen.data.example +++ b/certgen.data.example @@ -1,14 +1,25 @@ # Certgen config file -# Format: -# 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: +# EXIT +# CA +# SGN +# This will create a cert and sign with the ca located in ./ca/ +# CRT +# This will create a self signed cert. +# CSR +# 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/ diff --git a/certgen.sh b/certgen.sh index 4c9a822..b067d56 100755 --- a/certgen.sh +++ b/certgen.sh @@ -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 -- 2.43.0