Help - Search - Members - Calendar
Full Version: HOWTO: Manipulate PowerTools from the command line
The Planet Forums > Control Panels > Ensim > Ensim HOWTOs
Doobla
Since Ensim hasn't documented the Powertools yet (likely because they are still working on a lot of cool stuff to add in) I decided to figure out how to manipulate them from the command prompt. This comes largely from the fact that PowerTools are turned on in each domain by default but none of the tools are enabled and I am not about to edit each domain one by one to enable them.

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!'


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!'


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 icon_smile.gif

Jon
Doobla
Reserved icon_wink.gif
propcgamer
thanks, it worked well:D
outpernet
and to disable in all sites?
outpernet
ok, i figured:

#!/bin/sh
for Domain in `/usr/local/bin/sitelookup -a | cut -d, -f1`
do
echo "Disabling Powertools on $Domain"
/usr/local/bin/EditVirtDomain -c scriptsmgr,off $Domain
done
echo 'Done!'
perldork
Doobla,

Neat! I look forward to getting migrated to 3.5 icon_smile.gif ... what have reactions been from customers for anyone who has installed power tools? Are they impressed/happy/neutral/don't care?

Thanks for the post!
Doobla
QUOTE
Originally posted by perldork
Doobla,

Neat!  I look forward to getting migrated to 3.5 icon_smile.gif ... what have reactions been from customers for anyone who has installed power tools?  Are they impressed/happy/neutral/don't care?

Thanks for the post!


Well, this is not meant as a slam toward ensimshop and their tools, but I had/have ElitePro installed on my server and then I installed PowerTools and my customers never once commented about how they liked ElitePro, but I have recieved compliments about PowerTools and how easy it is to install scripts.

Especially because Ensim configures the script for the customer so you don'thave to worry abotu the support calls where the customer can't figure out why it doesn't work (especially on high security sites). they just fill in the information requested which is partially filled out already for them usually and then they click the button and go use the tool.

Long and the short of it, I use both companies' tools because PowerTools only has 8 scripts in it so far but I see PowerTools quickly taking the lead as they add more functionality as they are doing right now.
Kalapana
Is there a way to hide powertools from one reseller, but give to other resellers?

I want to make powertools an optional upcharge for my resellers that want it and hide it for those that don't want it.
outpernet
no yet..
mailparikshit
QUOTE (Doobla @ Sep 18 2003, 09:32 PM) *
Since Ensim hasn't documented the Powertools yet (likely because they are still working on a lot of cool stuff to add in) I decided to figure out how to manipulate them from the command prompt. This comes largely from the fact that PowerTools are turned on in each domain by default but none of the tools are enabled and I am not about to edit each domain one by one to enable them.
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:
2. DisableVirtOption
Example:
3. EditVirtDomain
Example:
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)
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!'

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!'

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 icon_smile.gif
Jon


how can i do same with windows based plesk 8.1 control panel through command line.?
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.