Make the PKI scripts work with /bin/sh.

Refs #6002
This commit is contained in:
Gunnar Beutner 2014-04-13 19:22:14 +02:00
parent 9a1410e241
commit c9b0a3f2ba
4 changed files with 7 additions and 7 deletions

View File

@ -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 && \

View File

@ -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 <name>" >&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"

View File

@ -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 <csr-file>" >&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

View File

@ -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