MOON
Server: Apache/2.2.31 (Unix) mod_ssl/2.2.31 OpenSSL/0.9.8e-fips-rhel5 mod_bwlimited/1.4
System: Linux csr818.wilogic.com 2.6.18-419.el5xen #1 SMP Fri Feb 24 22:50:37 UTC 2017 x86_64
User: digitals (531)
PHP: 5.4.45
Disabled: NONE
Upload Files
File: //scripts.20110531.215904.25158/exchangeacctdb
#!/usr/bin/perl

open(CONF,"/etc/wwwacct.conf") || die "/etc/wwwacct.conf not found\n";
while(<CONF>) {
        $_ =~ s/\n//g;
        if ($_ !~ /^;/) {
                if ($_ =~ /BILLMASTER/) {
                        (undef,$billmaster) = split(/ /, $_);
                }
	}
}

if ($billmaster eq "") { exit; }

chomp($hostname = `hostname`);

opendir(PKGS,"/var/cpanel/packages");
@PKGS=readdir(PKGS);
closedir(PKGS);

@PKGS=grep(!/^\./, @PKGS);


open(PKGLIST,">/var/cpanel/pkglist.db");
foreach $pkg (@PKGS) {
	print PKGLIST $pkg . "\n";
}
close(PKGLIST);

system("scp -o \"Protocol 1,2\" -q /var/cpanel/accts.db root\@${billmaster}:/var/cpanel/billing/${hostname}-accts.db");
system("scp -o \"Protocol 1,2\" -q /var/cpanel/pkglist.db root\@${billmaster}:/var/cpanel/billing/${hostname}.pkglist");

print "Billing Data Exchange completed\n";