#!/bin/sh

wget -nv -O - 'http://pro.cpanel.net/activate/index.cgi?ip=mine' > /dev/null
/usr/local/cpanel/cpkeyclt

if [ "`/usr/local/cpanel/cpanel -V | awk -F. '{print $1$2}'`" -lt 97 ]; then
        echo "Sorry, you must have cPanel 9.7 or later to use this feature"
	if [ -e "/var/cpanel/addonmoduleversions/pro" ]; then
		echo -n "failed" > /var/cpanel/addonmoduleversions/pro
	fi
        exit
fi

if [ "`/usr/local/cpanel/cpanel -F | grep pro`" = "" ]; then
	echo "Sorry, you must get a license for cPanel Pro before installing it.";
	if [ -e "/var/cpanel/addonmoduleversions/pro" ]; then
		echo -n "failed" > /var/cpanel/addonmoduleversions/pro
	fi
	exit
fi

echo -n "Press enter to continue."
read undef


tar -x -f pkg.tar.gz -z -v -C /usr/local

/scripts/ensurerpm ImageMagick

/usr/local/cpanel/bin/leechprotectinstall

/scripts/updatenow

/scripts/buildeximconf
