#!/bin/sh
# Script that installs Qt5 fix for framebuffer timeout
# Jesper Melin, maximatecc 

VERSION=1.0.0

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

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

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

if [ ! -f /opt/etc/rc3.d/S18StartupQt5FramebufferFix ]
then
	echo "file /opt/etc/rc3.d/S18StartupQt5FramebufferFix" 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/StartupQt5FramebufferFix_${VERSION}

exit $INSTALLATION_SUCCESS

