librenms/scripts/update-sql.php
Adam Amstrong b273e04241 /// -> //
git-svn-id: http://www.observium.org/svn/observer/trunk@3240 61d68cd4-352d-0410-923a-c4978735b2b8
2012-05-25 12:24:34 +00:00

27 lines
414 B
PHP
Executable File

#!/usr/bin/env php
<?php
include("config.php");
include("includes/functions.php");
if ($fd = @fopen($argv[1],'r'))
{
$data = fread($fd,4096);
while (!feof($fd))
{
$data .= fread($fd,4096);
}
foreach (explode("\n", $data) as $line)
{
$update = mysql_query($line);
// FIXME check query success?
echo("$line \n");
}
}
else
{
echo("ERROR: Could not open file \"$argv[1]\".\n");
}
?>