#!/bin/sh

if [ $UID = 0 ]
then
	echo $1|grep ":/"
	if [ $? = 0 ];then
		pkg=$(find /media -name $(basename $1))
	else
		pkg=$1
	fi
	(rm -f /tmp/pkg.txt
	installpkg $pkg|tee /tmp/pkg.txt)| $(zenity --progress --text="Installing $1" --pulsate --auto-close)	
	zenity --text-info --width=550 --height=450 --title="vinstallpkg" --filename="/tmp/pkg.txt"
	rm -f /tmp/pkg.txt
else
	zenity --error --title="vinstallpkg" --text="This needs to run as root"
fi
