#!/usr/bin/perl
# cpanel - autofixer2/pureftpd_rebuild_conf       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 strict;

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

use Cpanel::Version;

our $VERSION = 1.0;

my $script    = "/usr/local/cpanel/bin/build_ftp_conf";
my $touchfile = "/var/cpanel/autofixer2-pureftpd_rebuild_conf-0";

if ( ( -e '/etc/pure-ftpd.conf.rpmsave' || -e '/etc/proftpd.conf.rpmsave' ) && $Cpanel::Version::MAJORVERSION >= 11.35 && !-e $touchfile && -x $script ) {
    system $script;
    system "/usr/local/cpanel/scripts/restartsrv_ftpserver";
    system "touch", $touchfile;
}

