So here goes: (make sure you are logged in as root via SSH)
First of all, there are three main scripts that Ensim provides to manipulate the features for a domain. They are:
1. EnableVirtOption
Example:
QUOTE
EnableVirtOption domain.com scriptsmgr
2. DisableVirtOption
Example:
QUOTE
DisableVirtOption domain.com scriptsmgr
3. EditVirtDomain
Example:
QUOTE
EditVirtDomain -c scriptsmgr,enabled=1 domain.com
Now that is the easy part because they give you that information when you run the given script. What they don't give you (yet) is the documentation on how to enable or disable a given tool for a domain. Below is a list of the current PowerTools and their associated internal names:
Power Tool Internal name
------------------ ---------------------
PhpBB 2.0.6 phpbb-2.0.6
PHP-Nuke CMS 6.9 phpnuke-6.9
PostNuke CMS 0.7.2.6 postnuke-0.7.2.6
Invision Board 1.1.2 invboard-1.1.2
Formmail PHP Script 4.2b formmail-4.2b
PHPOpenChat Chat System 3.0.0b3 phpopenchat-3.0.0b3
osCommerce Online Store 2.2ms2 oscommerce-2.2ms2
Gallery Photo Album System 1.3.4 gallery-1.3.4
So, with this information we can now modify these settings from the command line.
Example: (Gives domain.com the ability to install PHPNuke)
QUOTE
EditVirtDomain -c scriptsmgr,phpnuke-6.9=1 domain.com
Now here are a few scripts that will prove useful:
Enables all PowerTools for all sites
CODE
#!/bin/sh
for Domain in `/usr/local/bin/sitelookup -a | cut -d, -f1`
do
echo "Enabling Powertools on $Domain"
/usr/local/bin/EditVirtDomain -c scriptsmgr,enabled=1 -c scriptsmgr,phpbb-2.0.6=1 -c scriptsmgr,phpnuke-6.9=1 -c scriptsmgr,postnuke-0.7.2.6=1 -c scriptsmgr,invboard-1.1.2=1 -c scriptsmgr,formmail-4.2b=1 -c scriptsmgr,phpopenchat-3.0.0b3=1 -c scriptsmgr,oscommerce-2.2ms2=1 -c scriptsmgr,gallery-1.3.4=1 $Domain
done
echo 'Done!'
for Domain in `/usr/local/bin/sitelookup -a | cut -d, -f1`
do
echo "Enabling Powertools on $Domain"
/usr/local/bin/EditVirtDomain -c scriptsmgr,enabled=1 -c scriptsmgr,phpbb-2.0.6=1 -c scriptsmgr,phpnuke-6.9=1 -c scriptsmgr,postnuke-0.7.2.6=1 -c scriptsmgr,invboard-1.1.2=1 -c scriptsmgr,formmail-4.2b=1 -c scriptsmgr,phpopenchat-3.0.0b3=1 -c scriptsmgr,oscommerce-2.2ms2=1 -c scriptsmgr,gallery-1.3.4=1 $Domain
done
echo 'Done!'
Enables all PowerTools for all sites for a given reseller name
CODE
#!/bin/sh
Reseller_id=`/usr/local/bin/ListResellers | grep username=$1 |cut -d, -f13 |cut -d= -f2`
for Info in `sitelookup -a`
do
Site=`echo $Info|cut -d, -f3`
Domain=`echo $Info|cut -d, -f1`
DomainReseller=`fgrep reseller_id /home/virtual/$Site/info/current/reseller | cut -d= -f2`
if [ "$DomainReseller" = " $Reseller_id" ]; then
echo "Enabling Powertools on $Domain"
/usr/local/bin/EditVirtDomain -c scriptsmgr,enabled=1 -c scriptsmgr,phpbb-2.0.6=1 -c scriptsmgr,phpnuke-6.9=1 -c scriptsmgr,postnuke-0.7.2.6=1 -c scriptsmgr,invboard-1.1.2=1 -c scriptsmgr,formmail-4.2b=1 -c scriptsmgr,phpopenchat-3.0.0b3=1 -c scriptsmgr,oscommerce-2.2ms2=1 -c scriptsmgr,gallery-1.3.4=1 $Domain
fi
done
echo 'Done!'
Reseller_id=`/usr/local/bin/ListResellers | grep username=$1 |cut -d, -f13 |cut -d= -f2`
for Info in `sitelookup -a`
do
Site=`echo $Info|cut -d, -f3`
Domain=`echo $Info|cut -d, -f1`
DomainReseller=`fgrep reseller_id /home/virtual/$Site/info/current/reseller | cut -d= -f2`
if [ "$DomainReseller" = " $Reseller_id" ]; then
echo "Enabling Powertools on $Domain"
/usr/local/bin/EditVirtDomain -c scriptsmgr,enabled=1 -c scriptsmgr,phpbb-2.0.6=1 -c scriptsmgr,phpnuke-6.9=1 -c scriptsmgr,postnuke-0.7.2.6=1 -c scriptsmgr,invboard-1.1.2=1 -c scriptsmgr,formmail-4.2b=1 -c scriptsmgr,phpopenchat-3.0.0b3=1 -c scriptsmgr,oscommerce-2.2ms2=1 -c scriptsmgr,gallery-1.3.4=1 $Domain
fi
done
echo 'Done!'
These should work for everybody although my disclaimer is that I am just learning scripting and so it may not be the most efficient or I may have made a typo, but to the best of my knowledge this information is correct. Use at your own risk.
Please post comments and suggestions
Jon
