mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Detect if the destination of a rename is already in the system.
Patch by RobJE. git-svn-id: http://www.observium.org/svn/observer/trunk@2985 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -127,6 +127,7 @@ function renamehost($id, $new, $source = 'console')
|
||||
{
|
||||
global $config;
|
||||
|
||||
## FIXME does not check if destination exists!
|
||||
$host = dbFetchCell("SELECT `hostname` FROM `devices` WHERE `device_id` = ?", array($id));
|
||||
rename($config['rrd_dir']."/$host",$config['rrd_dir']."/$new");
|
||||
$return = dbUpdate(array('hostname' => $new), 'devices', 'device_id=?', array($id));
|
||||
|
||||
Reference in New Issue
Block a user