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

RS=value

For example:

BWLIMIT=unlimited
DEMO=0
DNS=domainname.com
FEATURELIST=default
HASCGI=1
IP=IPHERE
LANG=english
LOCALE=en
MAXADDON=0
MAXFTP=0
MAXLST=0
MAXPARK=0
MAXPOP=5
MAXSQL=0
MAXSUB=0
MTIME=1271068514
OWNER=root
PLAN=default
STARTDATE=1228721668
USER=username
RS=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 script:

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

here, it will change the cPanel theme of all the accounts on the server to ‘x3’ theme.  Since all the files are updated manually, you need to execute the following script to rebuild the cache

/scripts/updateuserdomains

Note: The single OR double quotes in the script may change to dot (.) on copy/pasting the command in the shell, so make sure you correct those before executing the command.

This entry was posted on Thursday, December 3rd, 2009 and is filed under cPanel Management. You can follow any responses to this entry through the RSS 2.0 feed. Both comments and pings are currently closed.

One Response to “Howto: Change cPanel theme for multiple accounts.”

Trackbacks

  1. LinuxHostingSupport.net » Blog Archive » Howto: Change cPanel … Leading just to Me