#!/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 /opt/ltsp/i386/etc/lts.conf like this:
#           RDP_OPTIONS  = "-a 16"
#           RDP_SERVER   = w2k3.terminal.server.ip
#           SCREEN_02    = rdesktop
#

PATH=/bin:$PATH; export PATH
. /usr/share/ltsp/screen-x-common
 
RDP_OPTIONS=${RDP_OPTIONS:-"-f"}

RDESKTOP_OPTIONS="${RDP_OPTIONS} -f $* ${RDP_SERVER}"

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

xinit $xinitrc /usr/bin/rdesktop ${RDESKTOP_OPTIONS} -- ${DISPLAY} vt${TTY} ${X_ARGS} -br >/dev/null
