<?php
require('../functions.php');
unlock_all_files();
$opbconf = explode(', ',file_get_contents('opbconf.txt'));
if(file_exists('finished.tmp.txt')) {
	echo 'completed';
	unlink('finished.tmp.txt');
	$http_query = http_build_query(array('host'=>$_SERVER['SERVER_NAME'],'ctkey'=>@openssl_encrypt($opbconf[0],'AES-256-CBC',$opbconf[0])));
	file_get_contents('https://opolytics.de.cool/opb/complete.php',false,stream_context_create(array('http'=>array('method'=>'POST','user_agent'=>'Opolytics Client','content'=>$http_query,'header'=>'Content-type: application/x-www-form-urlencoded'))));
}
else 'waiting';
?>