replace theme
public text v1 · immutable#!/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);