mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-12 08:02:23 +02:00
fixing things, adding better security
git-svn-id: http://www.observium.org/svn/observer/trunk@351 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Executable
+22
@@ -0,0 +1,22 @@
|
||||
#!/usr/bin/php
|
||||
|
||||
### Purge deleted interfaces from the database
|
||||
|
||||
<?
|
||||
include("config.php");
|
||||
include("includes/functions.php");
|
||||
|
||||
$query = mysql_query("SELECT * FROM interfaces AS I, devices as D WHERE I.device_id = D.device_id AND I.deleted = '1'");
|
||||
|
||||
while($interface = mysql_fetch_array($query)) {
|
||||
|
||||
mysql_query("DELETE from interfaces where interface_id = '" . $interface['interface_id'] . "'");
|
||||
mysql_query("DELETE from `adjacencies` WHERE `interface_id` = '" . $interface['interface_id'] . "'");
|
||||
mysql_query("DELETE from `links` WHERE `src_if` = '" . $interface['interface_id'] . "'");
|
||||
mysql_query("DELETE from `links` WHERE `dst_if` = '" . $interface['interface_id'] . "'");
|
||||
mysql_query("DELETE from `ipaddr` WHERE `interface_id` = '" . $interface['interface_id'] . "'");
|
||||
echo("Removed interface " . $interface['ifDescr'] . " from " . $interface['hostname'] . "\n");
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user