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