MOON
Server: Apache
System: Linux vps.thepromohut.com 2.6.18-398.el5 #1 SMP Tue Sep 16 20:51:48 EDT 2014 i686
User: caretrak (507)
PHP: 5.2.10
Disabled: NONE
Upload Files
File: //scripts.20110601.041516.15411/remdefssl
#!/usr/bin/perl
# cpanel - remdefssl                              Copyright(c) 2010 cPanel, Inc.
#                                                           All rights Reserved.
# copyright@cpanel.net                                         http://cpanel.net
# This code is subject to the cPanel license. Unauthorized copying is prohibited

BEGIN { unshift @INC, '/usr/local/cpanel'; }

use Cpanel::EditHttpdconf ();

Cpanel::EditHttpdconf::edit_httpdconf(
    sub {
        my ( $rw_fh, $safe_replace_content_coderef ) = @_;
        my @new_content;
        my $indefssl_vhost = 0;

        while ( my $line = readline($rw_fh) ) {
            $indefssl_vhost = 1 if $line =~ m{VirtualHost\s+["]?_default_:443["]?}i;
            push @new_content, $line if !$indefssl_vhost;
            $indefssl_vhost = 0 if $indefssl_vhost && $line =~ m{\s*[<][/]VirtualHost[>]}i;
        }

        return "Edited by $0 " if $safe_replace_content_coderef->( $rw_fh, \@new_content );
        return;
    }
);

system '/scripts/initsslhttpd';