#!/bin/sh
#
# Script to run the RAC version of Xvnc in background as a daemon
#

# Source RAC configuration with all necessary variables.
if [ -f /etc/sysconfig/racvnc ]; then
        . /etc/sysconfig/racvnc
fi

racXvnc $* &

# Give Xvnc a chance to start up
sleep 3

echo "New '$desktopName' desktop is $host:$displayNumber"
echo "Starting applications $vncUserDir/racserver"
echo "Log file is $desktopLog"

export XAUTHORITY=$xauthorityFile
xsetroot -display :$displayNumber -solid red -name $desktopName >> $desktopLog 2>&1
xterm -display :$displayNumber -geometry 80x24+10+10 -ls -bg white -fg black -title "Dell_Remote_Service" >> $desktopLog 2>&1 &
twm -display :$displayNumber -f /var/racvnc/rac.twmrc  >> $desktopLog 2>&1 &

exit 0
