2007-10-26 22:44:33 +00:00
|
|
|
#XCATDIR=`gettab key=xcatconfdir site.value`
|
|
|
|
# IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html
|
2007-12-18 19:07:58 +00:00
|
|
|
if [ -z "$XCATROOT" ]; then
|
|
|
|
XCATROOT=/opt/xcat
|
|
|
|
fi
|
2007-10-26 22:44:33 +00:00
|
|
|
if [ -z "$XCATDIR" ]; then
|
|
|
|
XCATDIR=/etc/xcat
|
|
|
|
fi
|
|
|
|
if [ -z "$1" ]; then
|
|
|
|
echo "Usage: $0 <CA name>"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
CNA="$*"
|
|
|
|
|
|
|
|
XCATCADIR=$XCATDIR/ca
|
|
|
|
|
|
|
|
if [ -e $XCATDIR/ca ]; then
|
|
|
|
echo -n "Existing xCAT certificate authority detected at $XCATDIR/ca, delete? (y/n):"
|
|
|
|
read ANSWER
|
|
|
|
if [ $ANSWER != 'y' ]; then
|
|
|
|
echo "Aborting install at user request"
|
|
|
|
exit 0;
|
|
|
|
fi
|
|
|
|
rm -rf $XCATDIR/ca
|
|
|
|
mkdir -p $XCATDIR/ca
|
|
|
|
else
|
|
|
|
mkdir -p $XCATDIR/ca
|
|
|
|
fi
|
2007-12-18 19:07:58 +00:00
|
|
|
sed -e "s@##XCATCADIR##@$XCATCADIR@" $XCATROOT/share/xcat/ca/openssl.cnf.tmpl > $XCATCADIR/openssl.cnf
|
|
|
|
cp $XCATROOT/share/xcat/ca/Makefile $XCATCADIR/
|
2007-10-26 22:44:33 +00:00
|
|
|
cd $XCATCADIR
|
|
|
|
make init
|
2013-01-14 16:40:39 +00:00
|
|
|
openssl req -nodes -config openssl.cnf -days 7300 -x509 -newkey rsa:2048 -out ca-cert.pem -extensions v3_ca -outform PEM -subj /CN="$CNA"
|
2007-10-26 22:44:33 +00:00
|
|
|
cd -
|