#!/bin/bash

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd $DIR

. ../etc/server.conf
export LC_ALL=C

export IS_V1_DISPLAY=1
export IS_V2_DISPLAY=0

# Test if we are installed on a pi, then vcgencmd exists
if command -v vcgencmd &> /dev/null
then
  export IS_V1_DISPLAY=0
  export IS_V2_DISPLAY=0
fi

if [ -e "/usr/local/Repetier-Setup/display_v2" ] ; then
  export IS_V1_DISPLAY=0
  export IS_V2_DISPLAY=1
fi

if [ "$IS_V1_DISPLAY" == "1" ] ; then
  cp display_v1/* .
  chmod a+rx *
fi
