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:
parent
9d374c1421
commit
0a4d227a2d
16
xCAT-server/share/xcat/scripts/exportxcatcreds.sh
Normal file
16
xCAT-server/share/xcat/scripts/exportxcatcreds.sh
Normal 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
|
Loading…
Reference in New Issue
Block a user