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
    UK based web hosting, reseller accounts and fully managed dedicated and virtual servers! In our 12th year and counting...

  3. #3
    ... 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..
    Brad Mahaffey - VanillaGreen.com
    Blood Sweat Vector

  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:
    [ james@admin ] ~$ cat test
    RS=x2
    RS=x
    RS=letterxhere
    
    [ james@admin ] ~$ perl -pi -e "s/RS=x\n/RS=x2\n/g" test
    [ james@admin ] ~$ cat test
    RS=x2
    RS=x2
    RS=letterxhere
    
    [ james@admin ] ~$
    Clook Internet
    UK based web hosting, reseller accounts and fully managed dedicated and virtual servers! In our 12th year and counting...

  6. #6
    Join Date
    Nov 2000
    Location
    Thailand
    Posts
    3,360
    Or you could just replace x2 before replacing x
    MattF - Since the start...

  7. Newsletters

    Subscribe Now & Get The WHT Quick Start Guide!

Related Posts from theWHIR.com

Posting Permissions

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