#! /bin/sh

chmod 755 _slpct_instlow

uname -a | grep -i "Linux"
if [ $? != 0 ]
then
	sudo ./_slpct_instlow
else
	uname -a | grep -i "ubuntu"
	if [ $? != 0 ]
	then
		su -c ./_slpct_instlow
	else
		sudo ./_slpct_instlow
	fi
fi

if [ $? != 0 ]
then
	echo "impossibile proseguire nell'installazione di slpct"
	read -p "Press any key to continue... " -n1 -s
	exit 1
fi

DESKTOP_DIR=`echo ~/Desktop`

if [ ! -d "$DESKTOP_DIR" ]; then
	DESKTOP_DIR=`echo ~/Scrivania`
fi

if [ ! -d "$DESKTOP_DIR" ]; then
	DESKTOP_DIR=`xdg-user-dir DESKTOP`
fi

cp -f slpctrun1.desktop $DESKTOP_DIR
chmod 755 "$DESKTOP_DIR/slpctrun1.desktop"

echo "Installazione di SLpct completata correttamente."
read -p "Press any key to continue... " -n1 -s

