diff --git a/app/scripts/resources/classes/scripts.php b/app/scripts/resources/classes/scripts.php index 8819b490cb..df0e24760f 100644 --- a/app/scripts/resources/classes/scripts.php +++ b/app/scripts/resources/classes/scripts.php @@ -17,7 +17,7 @@ The Initial Developer of the Original Code is Mark J Crane - Portions created by the Initial Developer are Copyright (C) 2008-2020 + Portions created by the Initial Developer are Copyright (C) 2008-2023 the Initial Developer. All Rights Reserved. Contributor(s): @@ -85,8 +85,13 @@ if (!class_exists('scripts')) { * Copy the switch scripts from the web directory to the switch directory */ public function copy_files() { - if (!empty($_SESSION['switch']['scripts'])) { - $destination_directory = $_SESSION['switch']['scripts']['dir']; + + //read the config.conf settings + $config_glob = glob("{/usr/local/etc,/etc}/fusionpbx/config.conf", GLOB_BRACE); + $conf = parse_ini_file($config_glob[0]); + + if (!empty($conf['switch.scripts.dir'])) { + $destination_directory = $conf['switch.scripts.dir']; if ($destination_directory != '' && file_exists($destination_directory)) { //get the source directory if (file_exists('/usr/share/examples/fusionpbx/scripts')) {