diff options
author | Ermal <eri@pfsense.org> | 2011-05-18 22:49:07 +0000 |
---|---|---|
committer | Ermal <eri@pfsense.org> | 2011-05-18 22:49:07 +0000 |
commit | 941baf1e268f9e4483983a14c55de1b3cc20efea (patch) | |
tree | 0668c00a7d2fa593aac620fb622547886e12f552 | |
parent | 6c19757e1503939eaa018f7f72bc2209d8a747b1 (diff) | |
download | pfsense-941baf1e268f9e4483983a14c55de1b3cc20efea.zip pfsense-941baf1e268f9e4483983a14c55de1b3cc20efea.tar.gz |
When uninstalling packages try to remove even any rc files created by packages.
-rw-r--r-- | etc/inc/pkg-utils.inc | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/etc/inc/pkg-utils.inc b/etc/inc/pkg-utils.inc index d475a40..070dade 100644 --- a/etc/inc/pkg-utils.inc +++ b/etc/inc/pkg-utils.inc @@ -895,7 +895,7 @@ function delete_package($pkg) { } function delete_package_xml($pkg) { - global $g, $config, $static_output, $pkg_interface; + global $g, $config, $static_output, $pkg_interface, $rcfileprefix; conf_mount_rw(); @@ -967,6 +967,13 @@ function delete_package_xml($pkg) { if($instservice['name'] == $service['name']) { if($g['booting'] != true) stop_service($service['name']); + if($service['rcfile']) { + $prefix = $rcfileprefix; + if (!empty($service['prefix'])) + $prefix = $service['prefix']; + if (file_exists("{$prefix}{$service['rcfile']}")) + @unlink("{$prefix}{$service['rcfile']}"); + } unset($services[$key]); } } |