Source

stacklet / specs / distro / gel / 5 / cpanel / assets / cpanel.sh

#!/bin/bash

if [ -d /usr/local/cpanel ]; then
  echo "CPanel is already installed -- exiting"
  exit 1
fi

cd /home

for i in {1..5}
do
   wget -SN --retry-connrefused --tries 5 http://httpupdate.cpanel.net/latest
   if [[ $? -eq 0 ]] ; then
    break
   fi
   echo 'Retry in three seconds'
   sleep 3
done

if [[ -e './latest' ]] ; then
  echo 'Retrieved http://httpupdate.cpanel.net/latest'
  chkconfig stkinstall off
  chmod a+x latest
  ./latest
else
  echo 'Could not retrieve http://httpupdate.cpanel.net/latest'     
  exit 1
fi