From c9b0a3f2bac4235d1d30dec8069c36388636fe30 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Sun, 13 Apr 2014 19:22:14 +0200 Subject: [PATCH] Make the PKI scripts work with /bin/sh. Refs #6002 --- pki/icinga2-build-ca.cmake | 4 ++-- pki/icinga2-build-key.cmake | 4 ++-- pki/icinga2-sign-key.cmake | 4 ++-- pki/pkifuncs | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pki/icinga2-build-ca.cmake b/pki/icinga2-build-ca.cmake index 4e2fc58fa..1fdea699d 100644 --- a/pki/icinga2-build-ca.cmake +++ b/pki/icinga2-build-ca.cmake @@ -1,7 +1,7 @@ #!/bin/sh ICINGA2PKIDIR=@CMAKE_INSTALL_FULL_DATADIR@/icinga2/pki -source $ICINGA2PKIDIR/pkifuncs +. $ICINGA2PKIDIR/pkifuncs check_pki_dir @@ -16,7 +16,7 @@ echo '01' > $ICINGA_CA/serial touch $ICINGA_CA/index.txt cp $ICINGA2PKIDIR/vars $ICINGA_CA/ -source $ICINGA_CA/vars +. $ICINGA_CA/vars KEY_DIR=$ICINGA_CA openssl req -config $ICINGA2PKIDIR/openssl.cnf -new -newkey rsa:4096 -x509 -days 3650 -keyform PEM -keyout $ICINGA_CA/ca.key -outform PEM -out $ICINGA_CA/ca.crt && \ chmod 600 $ICINGA_CA/ca.key && \ diff --git a/pki/icinga2-build-key.cmake b/pki/icinga2-build-key.cmake index ef8eede1e..e23e07dad 100644 --- a/pki/icinga2-build-key.cmake +++ b/pki/icinga2-build-key.cmake @@ -1,7 +1,7 @@ #!/bin/sh ICINGA2PKIDIR=@CMAKE_INSTALL_FULL_DATADIR@/icinga2/pki -source $ICINGA2PKIDIR/pkifuncs +. $ICINGA2PKIDIR/pkifuncs if [ -z "$1" ]; then echo "Syntax: $0 " >&2 @@ -17,7 +17,7 @@ if [ ! -f $ICINGA_CA/ca.crt -o ! -f $ICINGA_CA/ca.key ]; then exit 1 fi -[ -f $ICINGA_CA/vars ] && source $ICINGA_CA/vars +[ -f $ICINGA_CA/vars ] && . $ICINGA_CA/vars [ -z "$REQ_COUNTRY_NAME" ] && export REQ_COUNTRY_NAME="AU" [ -z "$REQ_STATE" ] && export REQ_STATE="Some-State" diff --git a/pki/icinga2-sign-key.cmake b/pki/icinga2-sign-key.cmake index 524ab3f5a..24f63c24a 100644 --- a/pki/icinga2-sign-key.cmake +++ b/pki/icinga2-sign-key.cmake @@ -1,7 +1,7 @@ #!/bin/sh ICINGA2PKIDIR=@CMAKE_INSTALL_FULL_DATADIR@/icinga2/pki -source $ICINGA2PKIDIR/pkifuncs +. $ICINGA2PKIDIR/pkifuncs if [ -z "$1" ]; then echo "Syntax: $0 " >&2 @@ -24,7 +24,7 @@ if [ ! -f $ICINGA_CA/ca.crt -o ! -f $ICINGA_CA/ca.key ]; then exit 1 fi -[ -f $ICINGA_CA/vars ] && source $ICINGA_CA/vars +[ -f $ICINGA_CA/vars ] && . $ICINGA_CA/vars openssl x509 -days "$REQ_DAYS" -CA $ICINGA_CA/ca.crt -CAkey $ICINGA_CA/ca.key -req -in $ICINGA_CA/$csrfile -outform PEM -out $ICINGA_CA/$pubkfile.crt -CAserial $ICINGA_CA/serial diff --git a/pki/pkifuncs b/pki/pkifuncs index 661e05e4a..f99f0b521 100644 --- a/pki/pkifuncs +++ b/pki/pkifuncs @@ -1,4 +1,4 @@ -function check_pki_dir { +check_pki_dir() { if [ -z "$ICINGA_CA" ]; then echo "Please set the ICINGA_CA environment variable to the path for your Icinga CA." >&2 echo "e.g.: export ICINGA_CA=\"$HOME/icinga-ca\"" >&2