File: distrotest.php

package info (click to toggle)
phpsysinfo 3.2.5-3
  • links: PTS
  • area: main
  • in suites: bullseye
  • size: 5,580 kB
  • ctags: 3,554
  • sloc: xml: 15,282; php: 12,220; sh: 29; makefile: 8
file content (45 lines) | stat: -rw-r--r-- 1,488 bytes parent folder | download
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
header("Content-Type: text/plain");
$filemaskarray=array("/etc/*-release",
                     "/etc/*_release",
                     "/etc/*-version",
                     "/etc/*_version",
                     "/etc/version",
                     "/etc/release",
                     "/etc/DISTRO_SPECS",
                     "/etc/eisfair-system",
                     "/usr/share/doc/tc/release.txt",
                     "/etc/synoinfo.conf",
                     "/etc/config/uLinux.conf",
                     "/etc/salix-update-notifier.conf",
                     "/etc/solydxk/info",
                     "/etc/vortexbox/vortexbox-version",
                     "/etc/GoboLinuxVersion",
                     "/etc/VERSION");
$fp = popen("lsb_release -a 2>/dev/null", "r");
if (is_resource($fp)) {
    $contents="";
    $start=true;
    while (!feof($fp)) {
        $contents=fgets($fp, 4096);
        if ($start && (strlen($contents)>0)) {
            echo "----------lsb_release -a----------\n";
            $start=false;
        }
        echo $contents;
    }
    if ((strlen($contents)>0)&&(substr($contents, -1)!="\n")) {
        echo "\n";
    }
    pclose($fp);
}

foreach ($filemaskarray as $filemask) {
    foreach (glob($filemask) as $filename) {
        echo "----------".$filename."----------\n";
        echo $contents=file_get_contents($filename);
        if ((strlen($contents)>0)&&(substr($contents, -1)!="\n")) {
            echo "\n";
        }
    }
}