2018-03-27 17:08:11 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
if (!file_exists('bot.lock')) {
|
|
|
|
touch('bot.lock');
|
|
|
|
}
|
|
|
|
$lock = fopen('bot.lock', 'r+');
|
2018-03-27 20:23:15 +02:00
|
|
|
|
|
|
|
$try = 1;
|
|
|
|
$locked = false;
|
|
|
|
while (!$locked) {
|
2018-03-27 20:23:34 +02:00
|
|
|
$locked = flock($lock, LOCK_EX | LOCK_NB);
|
2018-03-27 20:23:15 +02:00
|
|
|
if (!$locked) {
|
|
|
|
ob_end_clean();
|
2018-03-27 20:23:34 +02:00
|
|
|
header('Connection: close');
|
2018-03-27 20:23:15 +02:00
|
|
|
ignore_user_abort(true);
|
|
|
|
ob_start();
|
2018-03-27 20:23:34 +02:00
|
|
|
echo '<html><body><h1>OK!</h1></body</html>';
|
2018-03-27 20:23:15 +02:00
|
|
|
$size = ob_get_length();
|
|
|
|
header("Content-Length: $size");
|
2018-03-27 20:23:34 +02:00
|
|
|
header('Content-Type: text/html');
|
2018-03-27 20:23:15 +02:00
|
|
|
ob_end_flush();
|
|
|
|
flush();
|
|
|
|
|
|
|
|
if ($try++ >= 30) {
|
|
|
|
exit;
|
|
|
|
}
|
|
|
|
sleep(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
require __DIR__.'/madeline.php';
|
2018-03-27 17:08:11 +02:00
|
|
|
require __DIR__.'/functions.php';
|
2018-03-27 20:23:15 +02:00
|
|
|
|
|
|
|
register_shutdown_function('shutdown_function', $lock);
|
|
|
|
|
|
|
|
$leggi_messaggi_in_uscita = false;
|
|
|
|
|
|
|
|
$lista_admin = [
|
|
|
|
40955937, //id di Bruno :D
|
|
|
|
101374607, //id del creatore di MadelineProto :D
|
|
|
|
12344567, //un id probabilmente inesistente
|
|
|
|
];
|