#!/bin/bash
#
if [ "$LOGNAME" = "root" ]; then
	echo ''
	echo 'Installing PushMe...'
	echo ''
	echo -n 'looking for earlier installed version...'
	if [ ! -f /opt/kde/share/applnk/Games/pushme.kdelnk ]; then
		echo ' installing for the first time...'
		EARLIER=0
	else
		echo ' earlier version found...'
		EARLIER=1
	fi
	cp -f ./catch_me /opt/kde/bin
	if [ "$EARLIER" = "0" ]; then
		echo 'Creating directory...'
		mkdir -f /opt/kde/share/apps/pushme
		echo 'Copying files...'
		cp -f * /opt/kde/share/apps/pushme/
		cp -f ./pushme.kdelnk /opt/kde/share/applnk/Games/pushme.kdelnk
		echo ''
		echo 'Restarting panel... '
		kill -9 `ps aux|grep kpanel|awk '{ print $2 }'`
		kpanel&
	else
		echo ''
		echo 'PushMe binary updated...'
	fi
	echo ''
	echo 'PushMe installed.'
	echo ''
else
	echo ''
	echo 'ERROR ->'
	echo 'no installation possible: you are not the superuser...'
	echo ''
fi
