Wednesday, January 27, 2010

Howto: Change cPanel theme for multiple accounts.

How to change cPanel theme for multiple accounts?

The cPanel theme for an account is specified in the /var/cpanel/users/username file in the format CPMOD=x3

where, x3 is the theme. WHM only provides the option to change the cPanel theme for an account one at a time. In order to change the theme for all the accounts at once, execute the following command:

for i in `ls -la /var/cpanel/users/ | awk ‘{print $9}’ | sed ‘1,3 d’`; do sed -i “/CPMOD/d” $i; echo “CPMOD=x3″ >> $i; done;

here, it will change the cPanel theme of all the accounts on the server to ‘x3′ theme.

As the files are updated manually, you need to execute /scripts/updateuserdomains to rebuild the cache.

No comments:

Post a Comment