diff --git a/install.php b/install.php index 3e4a033..4bbc094 100644 --- a/install.php +++ b/install.php @@ -793,18 +793,23 @@ function Setup_RealTime() // Check extconfig file for correct connector values $ext_conf = ''; - $ext_conf_file = 'extconfig.conf'; + $ext_conf_file = ''; $backup_ext = array('_custom.conf', '_additional.conf','.conf'); foreach ($backup_ext as $value) { if (file_exists($dir . '/extconfig' . $value)) { // Last possibility is normal file extconfig.conf - $ext_conf_file = 'extconfig' . $value; + $ext_conf_file = $dir . 'extconfig' . $value; $ext_conf = $cnf_read->getConfig($ext_conf_file); break; } } + if (empty($ext_conf_file)) { + // Have not found a file, so will need to create. $ext_conf must be empty + $ext_conf_file = $dir . '/extconfig.conf'; + } if (!empty($ext_conf)) { + // Have found a file and read a config. Now need to check required settings $currentExtSettings = array(); $writeExtSettings = $ext_conf; if (empty($ext_conf['settings']['sccpdevice']) || ($ext_conf['settings']['sccpdevice'] !== $def_ext_config['sccpdevice'])) { @@ -816,9 +821,15 @@ function Setup_RealTime() $writeExtSettings['settings']['sccpline'] = $def_ext_config['sccpline']; } if (!empty($writeExtSettings)) { - outn("