#!/bin/sh
eval 'if [ -x /usr/local/cpanel/3rdparty/bin/perl ]; then exec /usr/local/cpanel/3rdparty/bin/perl -x -- $0 ${1+"$@"}; else exec /usr/bin/perl -x $0 ${1+"$@"}; fi;'
  if 0;

#!/usr/bin/perl
#-------------------------------------------------------------------------------
# cpanel - cronconfig/install                     Copyright(c) 2011 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', '/usr/local/cpanel/scripts';
}

print "<b>Now installing Cron Config...</b>\n";
system( "cp", "-f", "addon_cronconfig.cgi", "/usr/local/cpanel/whostmgr/docroot/cgi/addon_cronconfig.cgi" );
print "<b>Done</b><br>\n";

my $CPARGS = ( $^O =~ /freebsd/i ? '-Rpf' : '-afv' );    # freebsd no longer supported but may have the module installed

if ( -e "/usr/local/cpanel/bin/register_appconfig" ) {
    system '/usr/local/cpanel/bin/register_appconfig', 'appconfig/cronconfig.conf';
}
else {
    if ( !-e "/var/cpanel/apps" ) {
        mkdir( '/var/cpanel/apps', 0755 );
    }
    system( "cp", $CPARGS, "appconfig/cronconfig.conf", "/var/cpanel/apps/cronconfig.conf" );
}

