#!/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=11
export NX_PORT

NX_ROOT=${HOME}/.nx
#NX_ROOT=/var/NX
export NX_PORT

NX_HOST=nx/nx,root=${NX_ROOT},log=errors,stat=stats
export NX_HOST

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

NX_AGENT=:${NX_PORT}
export NX_AGENT

LD_LIBRARY_PATH="${HOME}/NX/nxcomp:${HOME}/NX/nxcompext:${HOME}/NX/nx-X11/exports/lib"
export LD_LIBRARY_PATH

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

nxproxy/nxproxy -S -D ${DISPLAY} snaporaz.medialogic.it &

echo ""


