diff options
-rw-r--r-- | config/freeswitch_dev/v_config.inc | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/config/freeswitch_dev/v_config.inc b/config/freeswitch_dev/v_config.inc index b15b0eb0..74ba18ff 100644 --- a/config/freeswitch_dev/v_config.inc +++ b/config/freeswitch_dev/v_config.inc @@ -2978,10 +2978,16 @@ function sync_package_freeswitch() function pkg_add($pkg_download_path, $pkg_name) { - chdir('/tmp/'); - exec("fetch ".$pkg_download_path.$pkg_name); - exec("pkg_add -F ".$pkg_name); - exec("rm ".$pkg_name); + + $pkg_array = split("\.", $pkg_name); + //if the package is not installed then download and install it + if (!strlen(exec('pkg_info | grep '.$pkg_array[0])) > 0) { + chdir('/tmp/'); + exec("fetch ".$pkg_download_path.$pkg_name); + exec("pkg_add -F ".$pkg_name); + exec("rm ".$pkg_name); + } + } function v_php_install_command() |