Results 1 to 6 of 6
  1. #1

    Quick way to change cpanel theme on all accounts

    Is there a quick way to change the CPanel theme used on all web accounts?
    Hockey is Life

  2. #2
    Join Date
    May 2002
    Location
    UK
    Posts
    1,616
    Run this command:

    replace RS=oldtheme RS=newtheme -- /var/cpanel/users/*

    Change the bits in bold to the name of your old and new themes.
    Clook Internet - www.clook.net
    Fully managed UK based webhosting provider
    Est 2002, 24/7 phone support, all the bells and whistles!

  3. #3
    Join Date
    Feb 2004
    Posts
    161
    ... Or just go to your packages in WHM, and modify the theme for that package, it will then result in changing all the users cpanel themes that are under that package. Jim's command would work better for serverwide replacement, but you couldn't run it if your a reseller..

  4. #4
    There is a problem with the code provided. For example.. if you have some users on "x" theme and some on x2 then you run..
    replace RS=x RS=x2 -- /var/cpanel/users/*
    It will replace all the x2 themes with x22 which will stop them from working.
    In addition, if you have your own theme with x in there will be a problem. if you have resellers with an x in... etc..
    But don't get me wrong, it will save a lot of time just have to be usre to use with care.

  5. #5
    Join Date
    May 2002
    Location
    UK
    Posts
    1,616
    Originally posted by MartinK
    There is a problem with the code provided. For example.. if you have some users on "x" theme and some on x2 then you run..
    replace RS=x RS=x2 -- /var/cpanel/users/*
    It will replace all the x2 themes with x22 which will stop them from working.
    In addition, if you have your own theme with x in there will be a problem. if you have resellers with an x in... etc..
    But don't get me wrong, it will save a lot of time just have to be usre to use with care.
    You are correct, my apologies for overlooking that. A better way of doing this (changing all on 'x' to 'x2') via command line is to run the following command:

    perl -pi -e "s/RS=x\n/RS=x2\n/g" /var/cpanel/users/*

    An addition can be made to backup all modified files by running this which will make a backup with the same filename plus .bak in the same directory:

    perl -pi.bak -e "s/RS=x\n/RS=x2\n/g" /var/cpanel/users/*

    Code:
    [ [email protected] ] ~$ cat test
    RS=x2
    RS=x
    RS=letterxhere
    
    [ [email protected] ] ~$ perl -pi -e "s/RS=x\n/RS=x2\n/g" test
    [ [email protected] ] ~$ cat test
    RS=x2
    RS=x2
    RS=letterxhere
    
    [ [email protected] ] ~$
    Clook Internet - www.clook.net
    Fully managed UK based webhosting provider
    Est 2002, 24/7 phone support, all the bells and whistles!

  6. #6
    Join Date
    Nov 2000
    Location
    UK
    Posts
    3,507
    Or you could just replace x2 before replacing x
    MattF - Since the start... twitter / github

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •