aboutsummaryrefslogtreecommitdiffstats
path: root/config/suricata/suricata_uninstall.php
diff options
context:
space:
mode:
authorbmeeks8 <bmeeks8@bellsouth.net>2014-02-28 20:48:19 -0500
committerbmeeks8 <bmeeks8@bellsouth.net>2014-02-28 20:48:19 -0500
commit6311b451c5ed2af49e042e1a472fae73a4efaabd (patch)
treeb1dc87a8a3cc718c6c2da1e9795b6ed160a15be9 /config/suricata/suricata_uninstall.php
parent0abcaed0af51b255a10f29a4583c76f3a598e24f (diff)
parentc4332741001485a9b39cad63b02e7d5ef32900b1 (diff)
downloadpfsense-packages-6311b451c5ed2af49e042e1a472fae73a4efaabd.tar.gz
pfsense-packages-6311b451c5ed2af49e042e1a472fae73a4efaabd.tar.bz2
pfsense-packages-6311b451c5ed2af49e042e1a472fae73a4efaabd.zip
Merge branch 'suricata-0.2'
Diffstat (limited to 'config/suricata/suricata_uninstall.php')
-rw-r--r--config/suricata/suricata_uninstall.php30
1 files changed, 27 insertions, 3 deletions
diff --git a/config/suricata/suricata_uninstall.php b/config/suricata/suricata_uninstall.php
index 071a89a4..b8ea6097 100644
--- a/config/suricata/suricata_uninstall.php
+++ b/config/suricata/suricata_uninstall.php
@@ -73,8 +73,33 @@ if ($config['installedpackages']['suricata']['config'][0]['clearlogs'] == 'on')
}
/* Remove the Suricata GUI app directories */
-@unlink("/usr/local/pkg/suricata");
-@unlink("/usr/local/www/suricata");
+mwexec("/bin/rm -rf /usr/local/pkg/suricata");
+mwexec("/bin/rm -rf /usr/local/www/suricata");
+
+/* Remove our associated Dashboard widget config and files. */
+/* If "save settings" is enabled, then save old widget */
+/* container settings so we can restore them later. */
+$widgets = $config['widgets']['sequence'];
+if (!empty($widgets)) {
+ $widgetlist = explode(",", $widgets);
+ foreach ($widgetlist as $key => $widget) {
+ if (strstr($widget, "suricata_alerts-container")) {
+ if ($config['installedpackages']['suricata']['config'][0]['forcekeepsettings'] == 'on') {
+ $config['installedpackages']['suricata']['config'][0]['dashboard_widget'] = $widget;
+ if ($config['widgets']['widget_suricata_display_lines']) {
+ $config['installedpackages']['suricata']['config'][0]['dashboard_widget_rows'] = $config['widgets']['widget_suricata_display_lines'];
+ unset($config['widgets']['widget_suricata_display_lines']);
+ }
+ }
+ unset($widgetlist[$key]);
+ }
+ }
+ $config['widgets']['sequence'] = implode(",", $widgetlist);
+ write_config();
+}
+@unlink("/usr/local/www/widgets/include/widget-suricata.inc");
+@unlink("/usr/local/www/widgets/widgets/suricata_alerts.widget.php");
+@unlink("/usr/local/www/widgets/javascript/suricata_alerts.js");
/* Keep this as a last step */
if ($config['installedpackages']['suricata']['config'][0]['forcekeepsettings'] != 'on') {
@@ -83,7 +108,6 @@ if ($config['installedpackages']['suricata']['config'][0]['forcekeepsettings'] !
unset($config['installedpackages']['suricatasync']);
@unlink("{$suricata_rules_upd_log}");
mwexec("/bin/rm -rf {$suricatalogdir}");
- @unlink(SURICATALOGDIR);
log_error(gettext("[Suricata] The package has been removed from this system..."));
}