#!/bin/sh

#/**************************************************************************/
#/*                                                                        */
#/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/.         */
#/*                                                                        */
#/* NXSCRIPTS, NX protocol compression and NX extensions to this software  */
#/* are copyright of NoMachine. Redistribution and use of the present      */
#/* software is allowed according to terms specified in the file LICENSE   */
#/* which comes in the source distribution.                                */
#/*                                                                        */
#/* Check http://www.nomachine.com/licensing.html for applicability.       */
#/*                                                                        */
#/* NX and NoMachine are trademarks of Medialogic S.p.A.                   */
#/*                                                                        */
#/* All rights reserved.                                                   */
#/*                                                                        */
#/**************************************************************************/

set -x

cd ${HOME}/NX

NX_PORT=10
export NX_PORT

NX_ROOT=${HOME}/.nx

NX_HOST=nx/nx,connect=snaporaz,root=${NX_ROOT},log=session,stat=stats
export NX_HOST

NX_DISPLAY=${NX_HOST}:${NX_PORT}
export NX_DISPLAY

LD_LIBRARY_PATH="${HOME}/NX/nxcomp"
export LD_LIBRARY_PATH

PATH="${PATH}:${HOME}/NX/nxclient/nxclient:/usr/NX/bin:/opt/NX/bin"
export PATH

rm -rf ${HOME}/.nx/S-${NX_PORT} || exit
mkdir -p ${HOME}/.nx/S-${NX_PORT} || exit

nxproxy/nxproxy -S -D ${DISPLAY} 2>>${HOME}/.nx/S-${NX_PORT}/session &

echo ""


