2008-01-10 01:59:16 +00:00
|
|
|
#!/bin/sh
|
2008-02-08 21:12:56 +00:00
|
|
|
CONSERVER=$2
|
|
|
|
if [ -z "$CONSERVER" ]; then
|
|
|
|
CONSERVER=`nodels $1 nodehm.conserver`
|
|
|
|
fi
|
2008-02-01 16:23:20 +00:00
|
|
|
if [ -z "$CONSERVER" ]; then
|
2008-01-10 01:59:16 +00:00
|
|
|
CONSERVER=$XCATHOST
|
|
|
|
fi
|
2008-02-01 16:23:20 +00:00
|
|
|
if [ -z "$CONSERVER" ]; then
|
2008-01-10 01:59:16 +00:00
|
|
|
CONSERVER=localhost
|
|
|
|
fi
|
2008-01-10 02:02:57 +00:00
|
|
|
#NOTE: IPv6 is not good with the below if going by IP, needs more sophisticated
|
|
|
|
#parsing
|
|
|
|
CONSERVER=`echo $CONSERVER|cut -d: -f 1`
|
2008-01-10 01:59:16 +00:00
|
|
|
if [ ! -f $HOME/.consolerc ]; then
|
|
|
|
echo 'config * {' > $HOME/.consolerc
|
2008-01-11 21:34:25 +00:00
|
|
|
echo " port 782;" >> $HOME/.consolerc
|
|
|
|
echo " sslenabled yes;" >> $HOME/.consolerc
|
2008-01-10 01:59:16 +00:00
|
|
|
echo " sslauthority $HOME/.xcat/ca.pem;" >> $HOME/.consolerc
|
|
|
|
echo " sslcredentials $HOME/.xcat/client-cred.pem;" >> $HOME/.consolerc
|
|
|
|
echo '}' >> $HOME/.consolerc
|
|
|
|
fi
|
|
|
|
|
2008-04-07 13:11:02 +00:00
|
|
|
exec console -f -M $CONSERVER $1
|