Files
conetadm 5718e70f15 init
2024-11-14 21:11:06 +01:00

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>