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

VERSION=1.0.1

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

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

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

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

exit $INSTALLATION_SUCCESS

