xcat-core/xCAT-client/bin/rcons
lissav 98f191f7b1 fix -h and -v message
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@2438 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
2008-10-31 15:01:50 +00:00

37 lines
1002 B
Bash
Executable File

#!/bin/sh
CONSERVER=$2
if [ $1 = -h ]; then
echo "rcons - remotely accesses the serial console of a node"
echo "rcons <singlenode>"
echo "rcons [-h|--help|-v|--version]"
exit 0
fi
if [ $1 = -v ]; then
echo "Version 2.1"
exit 0
fi
#if [ -z "$CONSERVER" ]; then
# CONSERVER=`nodels $1 nodehm.conserver`
#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