summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--etc/inc/pkg-utils.inc15
1 files changed, 15 insertions, 0 deletions
diff --git a/etc/inc/pkg-utils.inc b/etc/inc/pkg-utils.inc
index f34f07c..c4e82bd 100644
--- a/etc/inc/pkg-utils.inc
+++ b/etc/inc/pkg-utils.inc
@@ -44,6 +44,7 @@ function restore_pkg_listtags() {
restore_pkg_listtags();
+require_once("service-utils.inc");
require_once("pfsense-utils.inc");
require_once("globals.inc");
@@ -664,6 +665,7 @@ function delete_package_xml($pkg) {
/* parse package configuration */
$packages = &$config['installedpackages']['package'];
$menus = &$config['installedpackages']['menu'];
+ $services = &$config['installedpackages']['service'];
if(file_exists("/usr/local/pkg/" . $packages[$pkgid]['configurationfile'])) {
$pkg_config = parse_xml_config("/usr/local/pkg/" . $packages[$pkgid]['configurationfile'], "packagegui");
/* remove menu items */
@@ -679,6 +681,19 @@ function delete_package_xml($pkg) {
$static_output .= "done.\n";
update_output_window($static_output);
}
+ /* remove services */
+ if(is_array($pkg_config['service'])) {
+ $static_output .= "\tServices... ";
+ update_output_window($static_output);
+ foreach($services as $service) $instservices[] = $service['name'];
+ foreach($pkg_config['service'] as $service) {
+ foreach($instservices as $key => $instservice) {
+ if($instservice == $service['name']) unset($services[$key]);
+ }
+ }
+ $static_output .= "done.\n";
+ update_output_window($static_output);
+ }
/* evalate this package's global functions and pre deinstall commands */
if($pkg_config['custom_php_global_functions'] <> "")
eval_once($pkg_config['custom_php_global_functions']);
OpenPOWER on IntegriCloud