All pastes #17119 Raw Edit

replace theme

public text v1 · immutable
#17119 ·published 2005-07-07 08:04 UTC
rendered paste body
#!/usr/bin/perl
$oldtheme = "xmodified-blue";
$newtheme = "x";
open(FILE,"/var/cpanel/resellers");
while(<FILE>) {
   if ($_ =~ /(.*):.*/) {
         $line = "";
         $user = $1;
         print "Checking reseller $1\n";
         open(RES, "</home/${user}/.whmtheme");
         while(<RES>) {
            $line = $_;
            chomp($line);
            print "Current Theme: $line\n";
         }
         close (RES);
         $line =~ s/${oldtheme}/${newtheme}/;
         open(RES, ">/home/${user}/.whmtheme");
         print RES $line;
         close(RES);
         print "New Theme: $line\n";

   }
}
close(FILE);