Merge pull request #2807 from wiad/issue-2806

Try to find rancid file based on both fqdn and short host name
This commit is contained in:
Neil Lathwood
2016-01-19 09:46:19 +00:00
+11 -1
View File
@@ -16,7 +16,17 @@ if ($_SESSION['userlevel'] >= '7') {
if (is_file($configs.$device['hostname'])) {
$file = $configs.$device['hostname'];
}
}
elseif (is_file($configs.strtok($device['hostname'], '.'))) { // Strip domain
$file = $configs.strtok($device['hostname'], '.');
}
else {
if (!empty($config['mydomain'])) { // Try with domain name if set
if (is_file($configs.$device['hostname'].'.'.$config['mydomain'])) {
$file = $configs.$device['hostname'].'.'.$config['mydomain'];
}
}
} // end if
}
echo '<div style="clear: both;">';