summaryrefslogtreecommitdiffstats
path: root/etc/inc
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2005-03-02 01:18:17 +0000
committerScott Ullrich <sullrich@pfsense.org>2005-03-02 01:18:17 +0000
commit4fa9d187879a9fd3adc128ff4c2c0ff4b0fc475a (patch)
treee858d9d962772bd4ff2cf65d94ea15553e8b5cf9 /etc/inc
parent8d8f27a14a0aea5ca6778544f9f95d1285c5baf0 (diff)
downloadpfsense-4fa9d187879a9fd3adc128ff4c2c0ff4b0fc475a.zip
pfsense-4fa9d187879a9fd3adc128ff4c2c0ff4b0fc475a.tar.gz
Move resync_all_packages_config to our utilities area
Diffstat (limited to 'etc/inc')
-rw-r--r--etc/inc/pfsense-utils.inc21
1 files changed, 20 insertions, 1 deletions
diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc
index b7d2648..7d9730e 100644
--- a/etc/inc/pfsense-utils.inc
+++ b/etc/inc/pfsense-utils.inc
@@ -509,5 +509,24 @@ function update_progress_bar($percent) {
echo "\n</script>";
}
+/*
+ * 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
OpenPOWER on IntegriCloud