-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmanual_update.php
45 lines (35 loc) · 959 Bytes
/
manual_update.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
// Turn off output buffering
ini_set('output_buffering', 'off');
// Turn off PHP output compression
ini_set('zlib.output_compression', false);
//Flush (send) the output buffer and turn off output buffering
//ob_end_flush();
while (@ob_end_flush());
// Implicitly flush the buffer(s)
ini_set('implicit_flush', true);
ob_implicit_flush(true);
//prevent apache from buffering it for deflate/gzip
header("Content-type: text/plain");
header('Cache-Control: no-cache'); // recommended to prevent caching of event data.
for($i = 0; $i < 8192; $i++)
{
echo ' ';
}
ob_flush();
flush();
/// Now start the program output
echo "Starting script...\n\n";
$cmd = "sh /media/sda1/html/scmapdb/cmd.sh 2>&1";
//while (@ ob_end_flush()); // end all output buffers if any
$proc = popen($cmd, 'r');
@ flush();
while (!feof($proc))
{
echo fread($proc, 4);
@ flush();
}
fclose($proc);
ob_flush();
flush();
?>