xcat-core/xCAT-client/bin/rcons
2008-06-03 14:56:33 +00:00

25 lines
696 B
Bash
Executable File

#!/bin/sh
CONSERVER=$2
#if [ -z "$CONSERVER" ]; then
# CONSERVER=`nodels $1 nodehm.conserver`
#fi
if [ -z "$CONSERVER" ]; then
CONSERVER=$XCATHOST
fi
if [ -z "$CONSERVER" ]; then
CONSERVER=localhost
fi
#NOTE: IPv6 is not good with the below if going by IP, needs more sophisticated
#parsing
CONSERVER=`echo $CONSERVER|cut -d: -f 1`
if [ ! -f $HOME/.consolerc ]; then
echo 'config * {' > $HOME/.consolerc
echo " port 782;" >> $HOME/.consolerc
echo " sslenabled yes;" >> $HOME/.consolerc
echo " sslauthority $HOME/.xcat/ca.pem;" >> $HOME/.consolerc
echo " sslcredentials $HOME/.xcat/client-cred.pem;" >> $HOME/.consolerc
echo '}' >> $HOME/.consolerc
fi
exec console -f -M $CONSERVER $1