Add script to export credentials for powershell client

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@15550 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
jbjohnso 2013-03-17 22:48:46 +00:00
parent 9d374c1421
commit 0a4d227a2d

View File

@ -0,0 +1,16 @@
TEMPDIR=`mktemp -d /tmp/xcatcreds.$$.XXXX`
if [ -r /etc/xcat/cert/server-cert.pem ]; then
SERVERNAME=`openssl x509 -in /etc/xcat/cert/server-cert.pem -noout -text|grep Subject:|sed -e 's/.*CN=//'`
echo 'xcatserver='$SERVERNAME > $TEMPDIR/xcat.cfg
fi
cp $HOME/.xcat/ca.pem $TEMPDIR/ca.pem
openssl pkcs12 -export -in $HOME/.xcat/client-cert.pem -inkey $HOME/.xcat/client-key.pem -out $TEMPDIR/user.pfx
cd $TEMPDIR
ZIPNAME="xcat-server.zip"
if [ ! -z "$SERVERNAME" ]; then
ZIPNAME="xcat-$SERVERNAME.zip"
fi
zip $HOME/$ZIPNAME *
cd -
echo "Credential package for powershell client can be found in $HOME/$ZIPNAME"
rm -rf $TEMPDIR