#!/bin/sh
#
# The following script works for LTSP5 and was tested in Ubuntu "Feisty" Linux.
# Original rdesktop script by James A. McQuillan,
# modified for LTSP5 by Colin Osterhout of SERRC (www.serrc.org).
#
# This software is licensed under the Gnu General Public License.
# The full text of which can be found at http://www.LTSP.org/license.txt
#
# Call this through lts.conf like this:
#           RDP_OPTIONS  = "-a 16"
#           RDP_SERVER   = w2k3.terminal.server.ip
#           SCREEN_02    = rdesktop
#
# or like this:
#           SCREEN_02    = "rdesktop -a 16 w2k3.terminal.server.ip"

PATH=/bin:$PATH; export PATH
. /usr/share/ltsp/screen-x-common
 
if boolean_is_true "${RDP_DAEMON:-"True"}"; then
    export XINITRC_DAEMON="True"
fi

if [ -x /usr/share/ltsp/xinitrc ]; then
    xinitrc=/usr/share/ltsp/xinitrc
fi

xinit $xinitrc sh /usr/share/ltsp/rdesktop.sh -- ${DISPLAY} vt${TTY} ${X_ARGS} -br >/dev/null 2>&1
