#!/bin/sh

MOD="logschedule"

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

if [ -e pkg.tar.gz ]; then
    rm -f pkg.tar.gz
fi

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

for file in `cat packing.lst`
do
    if [ -e /usr/local/${file}.bz2 ]; then
        rm -f /usr/local/${file}.bz2
    fi
done

CPARGS="-afv"

if [ "`uname -s`" = "FreeBSD" ]; then
   CPARGS="-Rpf"
fi
   
cp $CPARGS cpanel/* /usr/local/cpanel

