Prv8 Shell
Server : Apache/2.2.22 (Unix) mod_ssl/2.2.22 OpenSSL/1.0.0-fips mod_auth_passthrough/2.1 mod_bwlimited/1.4
System : Linux server.jackjohnson.com 2.6.32-279.5.2.el6.x86_64 #1 SMP Fri Aug 24 01:07:11 UTC 2012 x86_64
User : jackjohn ( 502)
PHP Version : 5.3.17
Disable Function : NONE
Directory :  /proc/self/root/scripts/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/self/root/scripts/checkproxysubdomains
#!/usr/local/cpanel/3rdparty/bin/perl
# cpanel - checkproxysubdomains                   Copyright(c) 2013 cPanel, Inc.
#                                                           All rights Reserved.
# copyright@cpanel.net                                         http://cpanel.net
# This code is subject to the cPanel license. Unauthorized copying is prohibited

use Cpanel::Proxy                ();
use Cpanel::Proxy::WebServer     ();
use Cpanel::Config::LoadCpConf   ();
use Cpanel::ConfigFiles          ();
use Cpanel::HttpUtils::ApRestart ();
use Cpanel::HttpUtils::Version   ();
use Cpanel::SafeRun::Errors      ();
use Getopt::Long;
use Pod::Usage;

if ( $> != 0 ) {
    die "Must be root to run /usr/local/cpanel/scripts/checkproxysubdomains";
}

# process arguments

my $help;
my $man;
my $force;
my $noreplace;

GetOptions( 'help' => \$help, 'man' => \$man, 'force' => \$force, 'no-replace' => \$noreplace );

pod2usage( { -verbose => 2 } ) if $man;
pod2usage(1) if $help;

$noreplace += 0;

# Verify it's configured
my $cpconf_ref = Cpanel::Config::LoadCpConf::loadcpconf();

#
# Version file 3 is to support autoconfig/autodiscover
#
my $version_file = '/var/cpanel/version/proxydomains3';

#
# If we have disabled the autoconfig proxy subdomains
# support we behave like the previous version
#
unless ( $cpconf_ref->{'autodiscover_proxy_subdomains'} ) {

    #
    # Version file 2 is to support webdisk
    #
    $version_file = '/var/cpanel/version/proxydomains2';
}

unless ( $force || ( defined $cpconf_ref->{'proxysubdomains'} && $cpconf_ref->{'proxysubdomains'} eq '1' && !-e $version_file ) ) {
    exit 0;
}

if ( open my $fh, '>', $version_file ) {
    print {$fh} time;
    close $fh;
}

print "***Updating DNS records***\n";
my $rsp = Cpanel::Proxy::setup_all_proxy_subdomains( no_replace => $noreplace );
foreach my $response ( @{$rsp} ) {
    print _pad( $response->{'domain'}, 35 ) . $response->{'msg'} . "\n";
}

system '/usr/local/cpanel/scripts/setupwebserverforproxysubdomains';

sub _pad {
    my ( $text, $length ) = @_;

    if ( length($text) > $length ) {
        return substr( $text, 0, ( $length - 1 ) ) . '…';
    }
    else {
        return $text . ( ' ' x ( $length - length $text ) );
    }
}

exit 0;

__END__

=head1 NAME

checkproxysubdomains - Update existing prodydomains install for webdisk, autodiscover, and/or autoconfig

=head1 SYNOPSIS

checkproxysubdomains [options]

    Options:
      --help        Brief help message
      --man         Full help message
      --force       Rerun configuration even if previously done

=head1 DESCRIPTION

The original implimentatin of proxydomains consisted of cpanel, whm
and webmail.  This script updates these older proxydomains configurations
to include the webdisk, autoconfig and autodiscover proxy subdomain.

Most likely, this program has already been run for you and you doesn't need
to be executed manually.

=cut

haha - 2025