Adjust the install path implementation.

This commit is contained in:
Mark Crane 2013-03-20 16:06:28 +00:00
parent 0e2551ed09
commit 8a4ba2566e
1 changed files with 40 additions and 24 deletions

View File

@ -143,30 +143,46 @@ require_once "includes/lib_functions.php";
//set specific alternative directories as required //set specific alternative directories as required
switch (PHP_OS) { switch (PHP_OS) {
case "Debian": case "Linux":
//if the Debian PKGS are installed use the following paths by default. //set the default db_path
if (file_exists('/var/lib/freeswitch')) { if (strlen($db_path) == 0) { //secure dir
//Debian Pkgs if (file_exists('/var/lib/fusionpbx')) {
//set the default db_path $db_path = '/var/lib/fusionpbx';
if (strlen($db_path) == 0) { //secure dir }
$db_path = '/var/lib/fusionpbx'; if (!is_readable($db_path)) { mkdir($db_path,0777,true); }
if (!is_readable($db_path)) { mkdir($db_path,0777,true); } }
} //set the other default directories
//set the other default directories if (file_exists('/usr/bin')) {
$switch_bin_dir = '/usr/bin'; //freeswitch bin directory $switch_bin_dir = '/usr/bin'; //freeswitch bin directory
$switch_conf_dir = '/etc/freeswitch'; }
$switch_db_dir = '/var/lib/freeswitch/db'; if (file_exists('/etc/freeswitch')) {
$switch_log_dir = '/var/log/freeswitch'; $switch_conf_dir = '/etc/freeswitch';
$switch_mod_dir = '/usr/lib/freeswitch/mod'; $switch_extensions_dir = $switch_conf_dir.'/directory';
$switch_extensions_dir = $switch_conf_dir.'/directory'; $switch_gateways_dir = $switch_conf_dir.'/sip_profiles';
$switch_gateways_dir = $switch_conf_dir.'/sip_profiles'; $switch_dialplan_dir = $switch_conf_dir.'/dialplan';
$switch_dialplan_dir = $switch_conf_dir.'/dialplan'; }
$switch_scripts_dir = '/usr/share/freeswitch/scripts'; if (file_exists('/var/lib/freeswitch/db')) {
$switch_grammar_dir = '/usr/share/freeswitch/grammar'; $switch_db_dir = '/var/lib/freeswitch/db';
$switch_storage_dir = '/var/lib/freeswitch/storage'; }
$switch_voicemail_dir = $switch_storage_dir.'/voicemail'; if (file_exists('/var/log/freeswitch')) {
$switch_recordings_dir = $switch_storage_dir.'/recordings'; $switch_log_dir = '/var/log/freeswitch';
$switch_sounds_dir = '/usr/share/freeswitch/sounds'; }
if (file_exists('/usr/lib/freeswitch/mod')) {
$switch_mod_dir = '/usr/lib/freeswitch/mod';
}
if (file_exists('/usr/share/freeswitch/scripts')) {
$switch_scripts_dir = '/usr/share/freeswitch/scripts';
}
if (file_exists('/usr/share/freeswitch/grammar')) {
$switch_grammar_dir = '/usr/share/freeswitch/grammar';
}
if (file_exists('/var/lib/freeswitch/storage')) {
$switch_storage_dir = '/var/lib/freeswitch/storage';
$switch_voicemail_dir = $switch_storage_dir.'/voicemail';
$switch_recordings_dir = $switch_storage_dir.'/recordings';
}
if (file_exists('/usr/share/freeswitch/sounds')) {
$switch_sounds_dir = '/usr/share/freeswitch/sounds';
} }
break; break;
case "FreeBSD": case "FreeBSD":