#!/bin/sh
# Script that installs Qt5 EvdevTouch parameters configuration file to calibrate touch screen and fix inverted axis
# Jesper Melin, maximatecc 

VERSION=1.0.0

echo "Installing Qt5EvdevTouchParameters_${VERSION}.tar.gz on unit"

tar -xzf ./Qt5EvdevTouchParameters_${VERSION}.tar.gz -C /

# Check that installation is succesful
if [ ! -f /opt/etc/evdevtouch_parameters.cfg ]
then
	echo "file /opt/etc/evdevtouch_parameters.cfg" missing
	INSTALLATION_SUCCESS=1
	exit $INSTALLATION_SUCCESS
fi

# Create a stamp to indicate installed package
if [ ! -d /opt/packages ]; then
	mkdir /opt/packages
fi
touch /opt/packages/Qt5EvdevTouchParameters_${VERSION}

exit $INSTALLATION_SUCCESS

