#!/usr/bin/perl
# cpanel - autofixer2/pre_edge_testing            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'; }

use Cpanel::Config ();

my %UPCONF;
Cpanel::Config::loadConfig( '/etc/cpupdate.conf', \%UPCONF );

print "Set cPanel update to NIGHTLY\n";
$UPCONF{'CPANEL'} = 'NIGHTLY';

# Make sure UPDATES does not exist so that 11.28->11.30 upgrade code is run.
delete $UPCONF{'UPDATES'} if ( exists $UPCONF{'UPDATES'} );

Cpanel::Config::flushConfig( '/etc/cpupdate.conf', \%UPCONF, '=' );

print "Run upcp\n";
$ENV{'CPANEL_IS_CRON'} = 0;
exec '/scripts/upcp --force';

