mrl14
03-04-2004, 05:04 PM
Is there a quick way to change the CPanel theme used on all web accounts?
![]() | View Full Version : Quick way to change cpanel theme on all accounts mrl14 03-04-2004, 05:04 PM Is there a quick way to change the CPanel theme used on all web accounts? Jim_UK 03-04-2004, 05:12 PM 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. p[] 03-04-2004, 09:23 PM ... 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.. MartinK 03-19-2004, 09:56 PM 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. Jim_UK 03-20-2004, 12:25 PM 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/* [ 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 ] ~$ MattF 03-20-2004, 12:41 PM Or you could just replace x2 before replacing x |