Home > Cpanel/WHM, Scripts > Fantastico Autoinstaller for Cpanel/WHM

Fantastico Autoinstaller for Cpanel/WHM

The installation of fantastico in WHM can now be automated using the following script. This script uses the python application named “twill-sh” to automate the installation process.

This script has been tested using cpanel version 11.30.6.3 and the latest version of fantastico(ie, De Luxe 2.10.4 r50 ). Please replace the URL,USER and PASS variables to match your servers WHM url,root user and password.

#!/bin/bash

#Assign root password to this variable
URL='http://162.24.12.23:2086'
USER='root'
PASS='myrootpass'

#Install ioncube and download fantastico files
/scripts/phpextensionmgr install IonCubeLoader
cd /usr/local/cpanel/whostmgr/docroot/cgi
wget -N http://files.betaservant.com/files/free/fantastico_whm_admin.tgz
tar -xzpf fantastico_whm_admin.tgz
rm -rf fantastico_whm_admin.tgz

#Installing twill(if it's not already installed) for web-browsing 
if [ ! -f /usr/bin/twill-sh ];then
	wget -O /tmp/twill-0.9.tar.gz http://darcs.idyll.org/~t/projects/twill-0.9.tar.gz
	cd  /tmp
	tar xzf twill-0.9.tar.gz
	cd twill-0.9
	python setup.py install
	python setup.py install_scripts
	cp -p twill-sh /usr/bin/
	chmod 755 /usr/bin/twill-sh
fi


#AutomatedForm submitter
cat > "/tmp/fantastico_twill.sh" << EEOF
go ${URL}
fv 1 user '${USER}'
fv 1 pass '${PASS}'
submit
go scripts/command?PFILE=Plugins
follow "addon_fantastico.cgi"
go fantastico.php?Primary_Action=Install&Secondary_Action=Pre
submit
go fantastico.php
submit
go fantastico.php?Primary_Action=Home
go fantastico.php?Primary_Action=Scripts&Secondary_Action=Update&Tertiary_Action=Missing
exit
EEOF

echo -e "\n\nTrying to install fantastico.. check /tmp/fantasticoinstall_log.txt`date +%F` for more details"

cat /tmp/fantastico_twill.sh|/usr/bin/twill-sh >>/tmp/fantasticoinstall_log.txt`date +%F`
if [ $? -ne 0 ];then
	#In case of error to retry drop the whmcs database and then try again
	echo "Installation failed. Check /tmp/fantasticoinstall_log.txt`date +%F` for more details"
	exit 1
else
	echo "Installation successful"
fi

#Clear unwanted files
rm -f /tmp/fantastico_twill.sh


########################################
#Uninstalling fantastico
# 
# 
# rm -rf /var/netenberg/
# rm -rf /usr/local/cpanel/whostmgr/docroot/cgi/fantastico/
# rm -rf /usr/local/cpanel/3rdparty/fantastico*
# rm -rf /usr/local/cpanel/base/frontend/*/fantastico
# rm -f /usr/local/cpanel/base/frontend/x/cells/fantastico.html
# rm -f /usr/local/cpanel/whostmgr/docroot/cgi/addon_fantastico.cgi
#
# crontab -l|grep -v "docroot/cgi/fantastico/scripts" > /tmp/fant.txt
# crontab /tmp/fant.txt
#
#
########################################
Advertisements
Categories: Cpanel/WHM, Scripts
  1. June 22, 2013 at 1:09 am

    It could be a excellent along with handy bit of info. We are content that you simply shared this useful info around. Please stop us knowledgeable such as this. Thanks for expressing.

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: