= $begin && $i<= $end) { $output .= $line . "\n"; } $i++; } return $output; } function tinc_status_usr2() { exec("/usr/local/sbin/tincd --config=/usr/local/etc/tinc -kUSR2"); usleep(500000); $clog_path = "/usr/local/sbin/clog"; $result = array(); exec("{$clog_path} /var/log/tinc.log | sed -e 's/.*tinc\[.*\]: //'",$result); $i = 0; foreach ($result as $line) { if (preg_match("/Statistics for Generic BSD tun device/",$line)) { $begin = $i; } if (preg_match("/End of subnet list./",$line)) { $end = $i; } $i++; } $output=""; $i = 0; foreach ($result as $line) { if ($i >= $begin && $i<= $end) { $output .= $line . "\n"; } $i++; } return $output; } $shortcut_section = "tinc"; $pgtitle = array(gettext("Status"), "tinc"); include("head.inc"); ?>
"> Connection list: