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: //proc/self/root/proc/self/root/scripts.20110531.215904.25158/dnstransfer
#!/usr/bin/perl
# cpanel4 - scripts        Copyright(c) 1997-2002 cPanel, Inc..
#                                 All rights Reserved.
# copyright@cpanel.net      http://cpanel.net
# This code is subject to the cpanel license. Unauthorized copying is prohibited
print "Rebuilding DNS Zones List from master server .....\n";

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


if ($dnsmaster eq "" || $dnsmaster eq "none") {
	print "Sorry no dns master was defined\n";
	exit;
}

system("cp -f /etc/named.conf /etc/named.conf.pretransfer");
system("scp  -o \"Protocol 1,2\"  $dnsmaster:/etc/named.conf /etc/named.conf.dnstransfer");

   ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
                      $atime,$mtime,$ctime,$blksize,$blocks)
                          = stat("/etc/named.conf.dnstransfer");

if ($size < 10) {
	print "Scp failed!\n";
	exit;
}


open(RNC,">/etc/named.conf");
open(NC,"/etc/named.conf.pretransfer");
while(<NC>) {
	if (/zone \"/) {
		last;
	}
	print RNC;
}
close(NC);

open(NC,"/etc/named.conf.dnstransfer");
$inzones = 0;
while(<NC>) {
	if (/zone \"/) {
		$inzones = 1;
	}
	if ($inzones) {
		print RNC;
	}
}
close(NC);
close(RNC);

system("/scripts/makesecondary");

print "Rebuild Complete\n";