diff options
author | Colin Smith <colin@pfsense.org> | 2005-03-02 03:40:14 +0000 |
---|---|---|
committer | Colin Smith <colin@pfsense.org> | 2005-03-02 03:40:14 +0000 |
commit | 238f696203dc4c25528e85a3a5d95185b968b436 (patch) | |
tree | 7c07e62df8817f281b8910e9e5b20295bf31c3a4 /etc | |
parent | c410cf554603cd3640a36ef5beabb87b7d59de5e (diff) | |
download | pfsense-238f696203dc4c25528e85a3a5d95185b968b436.zip pfsense-238f696203dc4c25528e85a3a5d95185b968b436.tar.gz |
* rc_packages -> rc.packages (hooks changed appropriately)
* resync_all_packages_config -> resync_all_package_configs (hooks changed appropriately)
* Add fetching of missing package XML to function resync_all_package_configs()
* Add resync_all_package_configs_bootup() to provide status of package syncing on bootup. (hooks changed appropriately)
Diffstat (limited to 'etc')
-rw-r--r-- | etc/inc/pfsense-utils.inc | 32 | ||||
-rwxr-xr-x | etc/rc | 4 |
2 files changed, 30 insertions, 6 deletions
diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc index 5350fd8..39b0890 100644 --- a/etc/inc/pfsense-utils.inc +++ b/etc/inc/pfsense-utils.inc @@ -510,16 +510,17 @@ function update_progress_bar($percent) { } /* - * resync_all_packages_config() Forces packages to setup their configuration and rc.d files + * resync_all_package_configs() Forces packages to setup their configuration and rc.d files */ -function resync_all_packages_config() { +function resync_all_package_configs() { log_error("Resyncing configuration for all packages."); if(!$config['installedpackages']['package']) return; 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. + log_error("Fetching missing configuration XML for " . $package . "."); + mwexec("fetch -o /usr/local/pkg/" . $package['configurationfile'] . " http://www.pfsense.com/packages/config/" . $package['configurationfile']); $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']); @@ -530,4 +531,27 @@ function resync_all_packages_config() { } } -?>
\ No newline at end of file +/* + * resync_all_package_configs_bootup() Force packages to setup their configuration and rc.d files at bootup. + * This function also prints output to the terminal indicating progress. + */ + +function resync_all_package_configs_bootup() { + log_error("Resyncing configuration for all packages."); + if(!$config['installedpackages']['package']) return; + 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 { + log_error("Fetching missing configuration XML for " . $package . "."); + system("fetch -o /usr/local/pkg/" . $package['configurationfile'] . " http://www.pfsense.com/packages/config/" . $package['configurationfile']); + $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. + print "Synced " . $package . ".\n"; + } +?> @@ -78,8 +78,8 @@ echo Starting USB... /usr/sbin/cron 2>>/tmp/bootup_messages -echo Syncing packages... -/etc/rc_packages +echo Syncing package configurations... +/etc/rc.packages echo Executing rc.d items... for FILE in /usr/local/etc/rc.d/*.sh; do |