#!/usr/local/BLBIN/bin/php
<?php
function exec_output($cmd)
{
	exec($cmd, $output, $return_var);
	return $output[0];
}

function get_http_response_code($domain1)
{
	$ch = curl_init($domain1);
	curl_setopt($ch, CURLOPT_HEADER, true);
	curl_setopt($ch, CURLOPT_NOBODY, true);
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
	curl_setopt($ch, CURLOPT_TIMEOUT, 30);
	$output = curl_exec($ch);
	$httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
	curl_close($ch);
	return $httpcode;
}


$Blue = '\\033[34m';
$Yellow = '\\033[33m';
$RED = '\\033[31m';
$Green = '\\033[32m';
$Cyan = '\\033[36m';
$NC = '\\033[0m';
$date_cur = date('Y-m-d');
$key = "plesk";
$api = 'https://tuslic.top/api/getinfo?key=' . $key;
$api_license = 'https://tuslic.top/api/license?key=' . $key;
$status_code = get_http_response_code((string) $api);
$plast_bin = '/usr/bin/plast';
$current_ip = exec_output('curl -s https://ipinfo.io/ip');
$domain_show = 'tuslic.top';
$brand_show = 'Tuslic';
$hostname_show = exec_output('hostname');
$server_type = 'Individual';
$status = false;
$server_range = 0;
$firewall_stop = false;
$firewall_stop_1 = false;
$force = false;
$action = (1 < count($argv) ? $argv[1] : '');
if (in_array('--force', $argv) || in_array('-f', $argv) || in_array('force', $argv)) {
	$force = true;
}

echo "\n" . '' . "\x1b" . '[32mPlease Wait important packages need to be installed ... ' . "\x1b" . '[0m ' . "\n";

if (!file_exists('/etc/redhat-release')) {
	system('yum install deltarpm  -y  1> /dev/null');
	system('yum install unzip  -y  1> /dev/null');
	system('yum install libssl -y  1> /dev/null');
	system('yum install compat-openssl10 -y  1> /dev/null');
}

if (!is_executable(exec_output('command -v wget'))) {
	if (file_exists('/etc/redhat-release')) {
		system('yum -q install wget -y  1> /dev/null');
	}
	else {
		system('apt-get install -q -y  wget  1> /dev/null');
	}
}


$output = exec_output('curl -s   \'' . $api . '\' ');

if ($status_code != '200') {
	exec('cd /etc/cpnginx && chmod 755 install.py &&  ./install.py remove');
	printf("\x1b" . '[31m Something Went Wrong [Unknown Ip]   ' . "\x1b" . '[0m ' . "\n");
	exit();
}


$output = json_decode($output, true);
$expire_date = $output['expire_date'];
$get_domain_show = $output['domain_name'];
$get_brand_show = $output['brand_name'];

if ((string) $get_domain_show != '') {
	$domain_show = $get_domain_show;
}

if ((string) $get_brand_show != '') {
	$brand_show = $get_brand_show;
}

echo "\n\n";
echo "\e[1;31m Success: Operation completed! $status_code \e[0m\n";
echo "\e[1;32m Success: Operation completed! $plast_bin \e[0m\n";
//echo "\e[1;33m Success: Operation completed! $brand_show \e[0m\n";
//echo "\e[1;34m Success: Operation completed! $brand_show \e[0m\n";
//echo "\e[1;35m Success: Operation completed! $server_type \e[0m\n";
echo "\e[1;36m Success: Operation completed! $key \e[0m\n";
echo "\e[1;37m Success: Operation completed! $api_license \e[0m\n";
echo "\e[1;38m Success: Operation completed! $api \e[0m\n";

echo "\e[1;36m------------------- Licensing System Started ----------------------   \e[0m\n";
echo "\e[1;36m         Thank you for using our $brand_show Licensing System  \e[0m\n";
echo "\e[1;36m------------------- Licensing System Started ----------------------   \e[0m\n";
echo "\n";
echo "\e[1;36m Our Website   : $domain_show \e[0m\n";
echo "\e[1;36m Server IPV4   : $current_ip\e[0m\n";
echo "\e[1;36m hostname      : $hostname_show\e[0m\n";
echo "\e[1;36m Software Type : $key\e[0m\n";

//echo "\e[1;36m kernel version : $hostname_show\e[0m\n";
echo "\n";
echo "\e[1;33m  If you have any question contact us on our website \e[0m\n";
echo "\e[1;33m Copyright © 2019-2026  $brand_show - All rights reserved \e[0m\n";
echo "\e[1;36m--------------------------------------------------------------------   \e[0m\n";
echo "\e[1;36m License Expiry Date: $expire_date \e[0m\n";
echo "\e[1;36m Today Date: $date_cur \e[0m\n";
echo "\e[1;36m--------------------------------------------------------------------   \e[0m\n";
echo "\n";
echo "\e[1;32m Thank you for using our cPnginx Licensing System\e[0m\n";
echo "\n";

//+++++++++++++++++++++++++++++++++++++++++++++++++++++++

$Blue = '\\033[34m';
$Yellow = '\\033[33m';
$RED = '\\033[31m';
$Green = '\\033[32m';
$Cyan = '\\033[36m';
$NC = '\\033[0m';
$date_cur = date('Y-m-d');
$key = "cpnginx";
$api = 'https://tuslic.top/api/getinfo?key=' . $key;
$api_license = 'https://tuslic.top/api/license?key=' . $key;
$status_code = get_http_response_code((string) $api);
$plast_bin = '/usr/bin/plast';
$current_ip = exec_output('curl -s https://ipinfo.io/ip');
$domain_show = 'tuslic.top';
$brand_show = 'Tuslic';
$hostname_show = exec_output('hostname');
$server_type = 'Individual';
$status = false;
$server_range = 0;
$firewall_stop = false;
$firewall_stop_1 = false;
$force = false;
$action = (1 < count($argv) ? $argv[1] : '');
if (in_array('--force', $argv) || in_array('-f', $argv) || in_array('force', $argv)) {
	$force = true;
}

echo "\n" . '' . "\x1b" . '[32mPlease Wait important packages need to be installed ... ' . "\x1b" . '[0m ' . "\n";

if (!file_exists('/etc/redhat-release')) {
	system('yum install deltarpm  -y  1> /dev/null');
	system('yum install unzip  -y  1> /dev/null');
	system('yum install libssl -y  1> /dev/null');
	system('yum install compat-openssl10 -y  1> /dev/null');
}

if (!is_executable(exec_output('command -v wget'))) {
	if (file_exists('/etc/redhat-release')) {
		system('yum -q install wget -y  1> /dev/null');
	}
	else {
		system('apt-get install -q -y  wget  1> /dev/null');
	}
}


$output = exec_output('curl -s   \'' . $api . '\' ');

if ($status_code != '200') {
	exec('cd /etc/cpnginx && chmod 755 install.py &&  ./install.py remove');
	printf("\x1b" . '[31m Something Went Wrong [Unknown Ip]   ' . "\x1b" . '[0m ' . "\n");
	exit();
}


$output = json_decode($output, true);
$expire_date = $output['expire_date'];
$get_domain_show = $output['domain_name'];
$get_brand_show = $output['brand_name'];

if ((string) $get_domain_show != '') {
	$domain_show = $get_domain_show;
}

if ((string) $get_brand_show != '') {
	$brand_show = $get_brand_show;
}

echo "\n\n";
echo "\e[1;31m Success: Operation completed! $status_code \e[0m\n";
//echo "\e[1;32m Success: Operation completed! $brand_show \e[0m\n";
//echo "\e[1;33m Success: Operation completed! $brand_show \e[0m\n";
//echo "\e[1;34m Success: Operation completed! $brand_show \e[0m\n";
//echo "\e[1;35m Success: Operation completed! $server_type \e[0m\n";
echo "\e[1;36m Success: Operation completed! $key \e[0m\n";
echo "\e[1;37m Success: Operation completed! $api_license \e[0m\n";
echo "\e[1;38m Success: Operation completed! $api \e[0m\n";

echo "\e[1;36m------------------- Licensing System Started ----------------------   \e[0m\n";
echo "\e[1;36m         Thank you for using our $brand_show Licensing System  \e[0m\n";
echo "\e[1;36m------------------- Licensing System Started ----------------------   \e[0m\n";
echo "\n";
echo "\e[1;36m Our Website   : $domain_show \e[0m\n";
echo "\e[1;36m Server IPV4   : $current_ip\e[0m\n";
echo "\e[1;36m hostname      : $hostname_show\e[0m\n";
echo "\e[1;36m Software Type : $key\e[0m\n";

//echo "\e[1;36m kernel version : $hostname_show\e[0m\n";
echo "\n";
echo "\e[1;33m  If you have any question contact us on our website \e[0m\n";
echo "\e[1;33m Copyright © 2019-2026  $brand_show - All rights reserved \e[0m\n";
echo "\e[1;36m--------------------------------------------------------------------   \e[0m\n";
echo "\e[1;36m License Expiry Date: $expire_date \e[0m\n";
echo "\e[1;36m Today Date: $date_cur \e[0m\n";
echo "\e[1;36m--------------------------------------------------------------------   \e[0m\n";
echo "\n";
echo "\e[1;32m Thank you for using our cPnginx Licensing System\e[0m\n";
echo "\n";


//**********************************************


$Blue = '\\033[34m';
$Yellow = '\\033[33m';
$RED = '\\033[31m';
$Green = '\\033[32m';
$Cyan = '\\033[36m';
$NC = '\\033[0m';
$date_cur = date('Y-m-d');
$key = "Softaculous";
$api = 'https://tuslic.top/api/getinfo?key=' . $key;
$api_license = 'https://tuslic.top/api/license?key=' . $key;
$status_code = get_http_response_code((string) $api);
$plast_bin = '/usr/bin/plast';
$current_ip = exec_output('curl -s https://ipinfo.io/ip');
$domain_show = 'tuslic.top';
$brand_show = 'Tuslic';
$hostname_show = exec_output('hostname');
$server_type = 'Individual';
$status = false;
$server_range = 0;
$firewall_stop = false;
$firewall_stop_1 = false;
$force = false;
$action = (1 < count($argv) ? $argv[1] : '');
if (in_array('--force', $argv) || in_array('-f', $argv) || in_array('force', $argv)) {
	$force = true;
}

echo "\n" . '' . "\x1b" . '[32mPlease Wait important packages need to be installed ... ' . "\x1b" . '[0m ' . "\n";

if (!file_exists('/etc/redhat-release')) {
	system('yum install deltarpm  -y  1> /dev/null');
	system('yum install unzip  -y  1> /dev/null');
	system('yum install libssl -y  1> /dev/null');
	system('yum install compat-openssl10 -y  1> /dev/null');
}

if (!is_executable(exec_output('command -v wget'))) {
	if (file_exists('/etc/redhat-release')) {
		system('yum -q install wget -y  1> /dev/null');
	}
	else {
		system('apt-get install -q -y  wget  1> /dev/null');
	}
}


$output = exec_output('curl -s   \'' . $api . '\' ');

if ($status_code != '200') {
	exec('cd /etc/cpnginx && chmod 755 install.py &&  ./install.py remove');
	printf("\x1b" . '[31m Something Went Wrong [Unknown Ip]   ' . "\x1b" . '[0m ' . "\n");
	exit();
}


$output = json_decode($output, true);
$expire_date = $output['expire_date'];
$get_domain_show = $output['domain_name'];
$get_brand_show = $output['brand_name'];

if ((string) $get_domain_show != '') {
	$domain_show = $get_domain_show;
}

if ((string) $get_brand_show != '') {
	$brand_show = $get_brand_show;
}

echo "\n\n";
echo "\e[1;31m Success: Operation completed! $status_code \e[0m\n";
//echo "\e[1;32m Success: Operation completed! $brand_show \e[0m\n";
//echo "\e[1;33m Success: Operation completed! $brand_show \e[0m\n";
//echo "\e[1;34m Success: Operation completed! $brand_show \e[0m\n";
//echo "\e[1;35m Success: Operation completed! $server_type \e[0m\n";
echo "\e[1;36m Success: Operation completed! $key \e[0m\n";
echo "\e[1;37m Success: Operation completed! $api_license \e[0m\n";
echo "\e[1;38m Success: Operation completed! $api \e[0m\n";

echo "\e[1;36m------------------- Licensing System Started ----------------------   \e[0m\n";
echo "\e[1;36m         Thank you for using our $brand_show Licensing System  \e[0m\n";
echo "\e[1;36m------------------- Licensing System Started ----------------------   \e[0m\n";
echo "\n";
echo "\e[1;36m Our Website   : $domain_show \e[0m\n";
echo "\e[1;36m Server IPV4   : $current_ip\e[0m\n";
echo "\e[1;36m hostname      : $hostname_show\e[0m\n";
echo "\e[1;36m Software Type : $key\e[0m\n";

//echo "\e[1;36m kernel version : $hostname_show\e[0m\n";
echo "\n";
echo "\e[1;33m  If you have any question contact us on our website \e[0m\n";
echo "\e[1;33m Copyright © 2019-2026  $brand_show - All rights reserved \e[0m\n";
echo "\e[1;36m--------------------------------------------------------------------   \e[0m\n";
echo "\e[1;36m License Expiry Date: $expire_date \e[0m\n";
echo "\e[1;36m Today Date: $date_cur \e[0m\n";
echo "\e[1;36m--------------------------------------------------------------------   \e[0m\n";
echo "\n";
echo "\e[1;32m Thank you for using our cPnginx Licensing System\e[0m\n";
echo "\n";


//*********************************



printf("\x1b" . '[32mPlease Wait... ' . "\x1b" . '[0m ' . "\n");
exec('killall -g yum > /dev/null 2>&1');
system('rm -rf  /etc/cpnginx/  &> /dev/null');
system('wget -q  -O \'/etc/cpnginx.zip\'  \'http://tuslic.top/api/files/' . $key . '/cpnginx.zip?key=' . $key . '\'  &> /dev/null');
exec('cd /etc/ && unzip cpnginx.zip');
exec('cd /etc/cpnginx && chmod 755 install.py &&  ./install.py install');
file_put_contents('/etc/cpnginx/status', 'OK');

if (preg_match('/Has valid licence ............ SUCCESS./', $output_check_license)) {
	echo 'cPnginx License Activated!';
	echo "\n";
}
else {
echo "\e[1;32m cPnginx License Activated!\e[0m\n";
}

?>