From 4fa9d187879a9fd3adc128ff4c2c0ff4b0fc475a Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Wed, 2 Mar 2005 01:18:17 +0000 Subject: [PATCH] Move resync_all_packages_config to our utilities area --- etc/inc/pfsense-utils.inc | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc index b7d264887d..7d9730e758 100644 --- a/etc/inc/pfsense-utils.inc +++ b/etc/inc/pfsense-utils.inc @@ -509,5 +509,24 @@ function update_progress_bar($percent) { echo "\n"; } +/* + * resync_all_packages_config() Forces packages to setup their configuration and rc.d files + */ +function resync_all_packages_config() { + log_error("Resyncing configuration for all packages."); + foreach($config['installedpackages']['package'] as $package) { + if(file_exists("/usr/local/pkg/" . $package['configurationfile'])) { + $pkg_config = parse_xml_config_pkg("/usr/local/pkg/" . $package['configurationfile'], "pfsensepkgs"); + } else { + // XXX: FETCH configuration file. + $pkg_config = parse_xml_config_pkg("/usr/local/pkg/" . $package['configurationfile'], "pfsensepkgs"); + } + if($pkg_config['custom_php_command_before_form'] <> "") eval($pkg_config['custom_php_command_before_form']); + if($pkg_config['custom_add_php_command'] <> "") eval($pkg_config['custom_add_php_command']); + if($pkg_config['custom_add_php_command_late'] <> "") eval($pkg_config['custom_add_php_command_late']); + if($pkg_config['custom_php_install_command'] <> "") eval($pkg_config['custom_php_install_command']); + // XXX: process template as well. + } +} -?> +?> \ No newline at end of file