#!/bin/bash
SW=stable

# Source global definitions
if [ -f /etc/bash.bashrc ]; then
        source /etc/bash.bashrc
elif [ -f /etc/bashrc ]; then
	source /etc/bashrc
fi

source /etc/lsb-release

SCR=/scratch/$USER/${SW}_${DISTRIB_CODENAME}
PY=$(type -p python)
if test -h "$PY"
then PVER=$(readlink $PY)
else PVER=$(python -c 'import sys; print "python%d%d" % sys.version.split('.')[:2];')
fi
export PATH=$SCR/bin:$PATH
export PYTHONPATH=$SCR/lib/$PVER/site-packages:$PYTHONPATH
export LD_LIBRARY_PATH=$SCR/lib:$LD_LIBRARY_PATH

exec "$@"
