diff options
Diffstat (limited to 'system/services/taskserver/certs/generate.ca')
-rwxr-xr-x | system/services/taskserver/certs/generate.ca | 40 |
1 files changed, 18 insertions, 22 deletions
diff --git a/system/services/taskserver/certs/generate.ca b/system/services/taskserver/certs/generate.ca index a9fbc0c..eb0dd5c 100755 --- a/system/services/taskserver/certs/generate.ca +++ b/system/services/taskserver/certs/generate.ca @@ -2,29 +2,26 @@ # Take the correct binary to create the certificates CERTTOOL=$(command -v gnutls-certtool 2>/dev/null || command -v certtool 2>/dev/null) -if [ -z "$CERTTOOL" ] -then - echo "ERROR: No certtool found" >&2 - exit 1 +if [ -z "$CERTTOOL" ]; then + echo "ERROR: No certtool found" >&2 + exit 1 fi . ./vars -if ! [ -f ca.key.pem ] -then - # Create a CA key. - $CERTTOOL \ - --generate-privkey \ - --sec-param $SEC_PARAM \ - --outfile ca.key.pem +if ! [ -f ca.key.pem ]; then + # Create a CA key. + $CERTTOOL \ + --generate-privkey \ + --sec-param $SEC_PARAM \ + --outfile ca.key.pem fi chmod 600 ca.key.pem -if ! [ -f ca.template ] -then - # Sign a CA cert. - cat <<EOF >ca.template +if ! [ -f ca.template ]; then + # Sign a CA cert. + cat <<EOF >ca.template organization = $ORGANIZATION cn = $CN CA country = $COUNTRY @@ -35,13 +32,12 @@ EOF #locality = $LOCALITY fi -if ! [ -f ca.cert.pem ] -then - $CERTTOOL \ - --generate-self-signed \ - --load-privkey ca.key.pem \ - --template ca.template \ - --outfile ca.cert.pem +if ! [ -f ca.cert.pem ]; then + $CERTTOOL \ + --generate-self-signed \ + --load-privkey ca.key.pem \ + --template ca.template \ + --outfile ca.cert.pem fi chmod 600 ca.cert.pem |