From 582c3984e5f442e3a09e7aca33fe19c06cac10bf Mon Sep 17 00:00:00 2001 From: wiad Date: Tue, 19 Jan 2016 10:00:14 +0100 Subject: [PATCH] Try to find rancid file based on both fqdn and short host name --- html/pages/device/showconfig.inc.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/html/pages/device/showconfig.inc.php b/html/pages/device/showconfig.inc.php index 675e43674c..410cc2f279 100644 --- a/html/pages/device/showconfig.inc.php +++ b/html/pages/device/showconfig.inc.php @@ -16,7 +16,15 @@ 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 '
';