From d75d69014dfdf62497090c93a507331a4bc4370e Mon Sep 17 00:00:00 2001 From: bmeeks8 Date: Sun, 14 Sep 2014 22:33:36 -0400 Subject: Tidy up our custom package deinstall function. --- config/snort/snort.inc | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'config/snort') diff --git a/config/snort/snort.inc b/config/snort/snort.inc index e579fdac..c4cd311d 100755 --- a/config/snort/snort.inc +++ b/config/snort/snort.inc @@ -3031,17 +3031,14 @@ function snort_deinstall() { } /**********************************************************/ - /* Test for existence of library backup tarballs in /tmp. */ - /* If these are present, then a package "delete" */ + /* Test for existence of the snort directory in the PBI */ + /* path. If not present, then a package "delete" */ /* operation is in progress and we need to wipe out the */ /* configuration files. Otherwise we leave the binary- */ /* side configuration intact since only a GUI files */ /* deinstall and reinstall operation is in progress. */ - /* */ - /* XXX: hopefully a better method presents itself in */ - /* future versions of pfSense. */ /**********************************************************/ - if (file_exists("/tmp/pkg_libs.tgz") || file_exists("/tmp/pkg_bins.tgz")) { + if (!is_dir("{$snortdir}")) { log_error(gettext("[Snort] Package deletion requested... removing all files...")); unlink_if_exists("{$rcdir}snort.sh"); rmdir_recursive("/usr/local/pkg/snort/"); -- cgit v1.2.3