Edit File: default
#!/usr/local/bin/php -c /usr/php.ini <?php // Turn off all error reporting error_reporting(0); $core = '4'; // 2 - 4 - 8 $ip = '51.210.113.204'; // Orginal IP $version = '6.0.12'; $litever = trim(file_get_contents('/usr/local/lsws/VERSION')); if($litever != $version){ system("service network restart"); unlink('/usr/local/lsws/conf/license.key'); unlink('/usr/local/lsws/conf/serial.no'); unlink('/usr/local/lsws/conf/trial.key'); system("/usr/local/lsws/admin/misc/lsup.sh -f -v $version"); } system("/sbin/ifconfig lo:0 $ip/32"); $hosts[1] = 'license.litespeedtech.com'; $hosts[2] = 'license2.litespeedtech.com'; $hosts[3] = 'license3.litespeedtech.com'; foreach ( $hosts as $zid => $block ){ $ip = ''; $ip = gethostbyname($block); system('/sbin/ifconfig lo:'.$zid.' '.$ip.'/32'); } function after ($thisa, $inthat) { if (!is_bool(strpos($inthat, $thisa))) return substr($inthat, strpos($inthat,$thisa)+strlen($thisa)); }; function after_last ($thisa, $inthat) { if (!is_bool(strrevpos($inthat, $thisa))) return substr($inthat, strrevpos($inthat, $thisa)+strlen($thisa)); }; function before ($thisa, $inthat) { return substr($inthat, 0, strpos($inthat, $thisa)); }; function before_last ($thisa, $inthat) { return substr($inthat, 0, strrevpos($inthat, $thisa)); }; function between ($thisa, $that, $inthat) { return before ($that, after($thisa, $inthat)); }; function between_last ($thisa, $that, $inthat) { return after_last($thisa, before_last($that, $inthat)); }; $shelldata = shell_exec('/usr/local/lsws/bin/lshttpd -t'); $shelldata = str_replace('expires','expire',$shelldata); $statusfile = file_get_contents('/tmp/lshttpd/.status'); $type = between('TYPE: ',"\n",$statusfile); if($type != $core){ $statusfile = str_replace("TYPE: ".$type,"TYPE: ".$core,$statusfile); file_put_contents('/tmp/lshttpd/.status',$statusfile); } $lsws_funcloc = '/usr/local/cpanel/whostmgr/docroot/cgi/lsws/bin/lsws_func'; $lsws_funcfile = file_get_contents($lsws_funcloc); if(strpos($lsws_funcfile,"LSWSBIN -V")){ $lsws_funcfile = str_replace("LSWSBIN -V","LSWSBIN -t",$lsws_funcfile); $lsws_funcfile = str_replace("LSWSBIN -r","LSWSBIN -t",$lsws_funcfile); file_put_contents($lsws_funcloc,$lsws_funcfile); } if (preg_match('/License key #(.*?) verification passed/', $shelldata, $day) === 1) { die('Your License is active , #'.$day[1].' KEY'." - $core CORE\n"); }else{ unlink('/usr/local/lsws/conf/license.key'); unlink('/usr/local/lsws/conf/serial.no'); unlink('/usr/local/lsws/conf/trial.key'); } system('cp /scripts/litelatest/license.key /usr/local/lsws/conf/license.key'); system('cp /scripts/litelatest/serial.no /usr/local/lsws/conf/serial.no'); $shelldata = shell_exec('/usr/local/lsws/bin/lshttpd -t'); $shelldata = str_replace('expires','expire',$shelldata); if (preg_match('/License key #(.*?) verification passed/', $shelldata, $day) === 1) { file_put_contents('/var/www/html/lic_check.php',base64_decode('PD9waHAKaGVhZGVyKCdDb250ZW50LVR5cGU6IGFwcGxpY2F0aW9uL2xpY2Vuc2Uta2V5Jyk7CmRpZShmaWxlX2dldF9jb250ZW50cygndHJpYWwua2V5JykpOwo/Pg==')); system('cp /usr/local/lsws/conf/license.key /var/www/html/trial.key'); $hosts[1] = 'license.litespeedtech.com'; $hosts[2] = 'license2.litespeedtech.com'; $hosts[3] = 'license3.litespeedtech.com'; foreach ( $hosts as $zid => $block ){ $ip = ''; $ip = gethostbyname($block); system('/sbin/ifconfig lo:'.$zid.' '.$ip.'/32'); } die('License Activated #'.$day[1]." KEY - $core CORE\n"); system('\cp /scripts/litelatest/license.key /usr/local/lsws/;cp /scripts/litelatest/serial.no /usr/local/lsws/;cp /scripts/litelatest/license.key /usr/local/lsws/conf/;cp /scripts/litelatest/serial.no /usr/local/lsws/conf/'); system('sh /usr/local/lsws/admin/misc/cp_switch_ws.sh lsws'); }else{ unlink('/usr/local/lsws/conf/license.key'); unlink('/usr/local/lsws/conf/serial.no'); unlink('/usr/local/lsws/conf/trial.key'); system('\cp /scripts/litelatest/license.key /usr/local/lsws/;cp /scripts/litelatest/serial.no /usr/local/lsws/;cp /scripts/litelatest/license.key /usr/local/lsws/conf/;cp /scripts/litelatest/serial.no /usr/local/lsws/conf/'); die('License Activation Failed'."\n"); system('sh /usr/local/lsws/admin/misc/cp_switch_ws.sh lsws'); } system('sh /usr/local/lsws/admin/misc/cp_switch_ws.sh lsws'); ?>