diff options
author | Christian Grothoff <christian@grothoff.org> | 2012-08-27 18:52:23 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2012-08-27 18:52:23 +0000 |
commit | 28dab9e4ac0d9475ad9bbdddb4d2c62280337af8 (patch) | |
tree | f77d6815fa2869cc2f838f21b85957be25d71980 /contrib/hostlist.php | |
parent | 5dd4fc72e4f42495791c070e33b854b0d25fa55e (diff) | |
download | gnunet-28dab9e4ac0d9475ad9bbdddb4d2c62280337af8.tar.gz gnunet-28dab9e4ac0d9475ad9bbdddb4d2c62280337af8.zip |
updating report.sh, removing obsolete hostlist scripts
Diffstat (limited to 'contrib/hostlist.php')
-rw-r--r-- | contrib/hostlist.php | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/contrib/hostlist.php b/contrib/hostlist.php deleted file mode 100644 index 158561542..000000000 --- a/contrib/hostlist.php +++ /dev/null | |||
@@ -1,35 +0,0 @@ | |||
1 | <?php | ||
2 | // Requires PHP >= 4.3.0 | ||
3 | // Author: "Krasko Oleksandr" <0m3r.mail@gmail.com> | ||
4 | // Minor improvements by Christian Grothoff <christian@grothoff.org> | ||
5 | header("Content-Type: application/octet-stream\r\n\r\n"); | ||
6 | $extmas = array(); | ||
7 | $pv=$_GET['p']; | ||
8 | if (isset($pv)) | ||
9 | { | ||
10 | for ($ii=0;$ii<64;$ii++) | ||
11 | if (0 != ($pv & (1 << $ii))) | ||
12 | $extmas[] = $ii; | ||
13 | } | ||
14 | else | ||
15 | { | ||
16 | $extmas = array('2','3','4','5','6','8','12','17','23','25'); | ||
17 | } | ||
18 | $path = '/var/lib/gnunet/data/hosts/'; // adjust as necessary | ||
19 | $dir = opendir($path); | ||
20 | if (! $dir) | ||
21 | die("Cannot open directory $path.\n"); | ||
22 | $mas = array(); | ||
23 | while ($fname = readdir($dir)) { | ||
24 | $fn = $path . '/' . $fname; | ||
25 | if (is_file($fn)) { | ||
26 | $dpo = strpos($fname, '.') + 1; | ||
27 | $len = strlen($fname); | ||
28 | if (in_array(substr($fname, $dpo - $len), $extmas)) | ||
29 | $mas[] = $fn; | ||
30 | } | ||
31 | } | ||
32 | shuffle($mas); // randomize order | ||
33 | foreach ($mas as $val) | ||
34 | echo file_get_contents($val); | ||
35 | ?> | ||