23 lines
470 B
PHP
23 lines
470 B
PHP
<html>
|
|
<head>
|
|
</head>
|
|
<body>
|
|
<?php
|
|
echo "Hostname: $_POST[hostname] Interface: $_POST[ifname]<br>\n";
|
|
?>
|
|
|
|
<?php
|
|
$if=$_POST['ifname'];
|
|
$line = file_get_contents("/home/rancid/var/rancid/network/configs/$_POST[hostname]");
|
|
$pattern = '#(interface ' . $if . '\n( (.*)\n)*)#i';
|
|
preg_match($pattern, $line, $match);
|
|
$str=$match[0];
|
|
$str2 = str_replace("\n","<br>\n",$str);
|
|
echo "<br><br>\n$str2\n<br><br>\n";
|
|
|
|
echo "<a href='site.html'>back</a>";
|
|
?>
|
|
|
|
</body>
|
|
</html>
|