} log_error(gettext("[Suricata] Finished rebuilding installation from saved settings...")); // Only try to start Suricata if not in reboot if (!$g['booting']) { if ($pkg_interface != "console") { update_status(gettext("Starting Suricata using rebuilt configuration...")); $static_output .= gettext("Starting Suricata using the rebuilt configuration..."); update_output_window($static_output); mwexec_bg("{$rcdir}suricata.sh start"); $static_output .= gettext(" done.\n"); update_output_window($static_output); } else { mwexec_bg("{$rcdir}suricata.sh start"); } } } // If this is first install and "forcekeepsettings" is empty, // then default it to 'on'. if (empty($config['installedpackages']['suricata']['config'][0]['forcekeepsettings'])) { $config['installedpackages']['suricata']['config'][0]['forcekeepsettings'] = 'on'; } // Finished with file system mods, so remount it read-only conf_mount_ro(); // Update Suricata package version in configuration $config['installedpackages']['suricata']['config'][0]['suricata_config_ver'] = $config['installedpackages']['package'][get_pkg_id("suricata")]['version']; write_config("Suricata pkg v{$config['installedpackages']['package'][get_pkg_id("suricata")]['version']}: post-install configuration saved."); // Done with post-install, so clear flag unset($g['suricata_postinstall']); log_error(gettext("[Suricata] Package post-installation tasks completed...")); update_status(""); return true;
} ?> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tbody> <tr> <td class="vncellt">HTTP Scanner</td> <td class="listr" width="75%"> <?php // HAVP version $pfs_version = substr(trim(file_get_contents("/etc/version")), 0, 3); if ($pfs_version == "2.1") { echo exec("pkg_info | grep \"[h]avp\""); } elseif ($pfs_version == "2.2") { // Show package version at least, no good quick way to get the PBI version echo "pkg v{$config['installedpackages']['package'][get_pkg_id("havp")]['version']}"; } else { pkg_exec("query '%v' havp", $version, $err); echo $version; } ?> </td> </tr> <tr> <td class="vncellt">Antivirus Scanner</td> <td class="listr" width="75%"> <?php // ClamD version echo exec("clamd -V"); ?> </td>
$todel = substr(reverse_strrchr($config['installedpackages']['package'][$id]['depends_on_package'], "."), 0, -1); delete_package($todel, htmlspecialchars($_GET['pkg'])); delete_package_xml(htmlspecialchars($_GET['pkg'])); update_status("Package deleted."); $static_output .= "\nPackage deleted."; update_output_window($static_output); break; case "showlog": $id = htmlspecialchars($_GET['pkg']); if (strpos($id, ".")) { exit; } update_output_window(file_get_contents("/tmp/pkg_mgr_{$id}.log")); break; case "reinstallpkg": $id = get_pkg_id(htmlspecialchars($_GET['pkg'])); $todel = substr(reverse_strrchr($config['installedpackages']['package'][$id]['depends_on_package'], "."), 0, -1); delete_package($todel, htmlspecialchars($_GET['pkg'])); delete_package_xml(htmlspecialchars($_GET['pkg'])); install_package(htmlspecialchars($_GET['pkg'])); update_status("Package reinstalled."); $static_output .= "\n\nPackage reinstalled."; start_service(htmlspecialchars($_GET['pkg'])); update_output_window($static_output); break; case "reinstallxml": delete_package_xml(htmlspecialchars($_GET['pkg'])); install_package(htmlspecialchars($_GET['pkg'])); $static_output .= "\n\nPackage reinstalled."; start_service(htmlspecialchars($_GET['pkg'])); update_output_window($static_output);
$apkg = $_GET['pkg']; if (!$apkg) { // If we aren't looking for a specific package, locate the first package that handles logging. if ($config['installedpackages']['package'] != "") { foreach ($config['installedpackages']['package'] as $package) { if (is_array($package['logging'])) { $pkgwithlogging = true; $apkg = $package['name']; $apkgid = $i; break; } $i++; } } } elseif ($apkg) { $apkgid = get_pkg_id($apkg); if ($apkgid != -1) { $pkgwithlogging = true; $i = $apkgid; } } $pgtitle = array(gettext("Status"), gettext("Package logs")); include "head.inc"; ?> <body link="#0000CC" vlink="#0000CC" alink="#0000CC"> <?php include "fbegin.inc"; ?> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td>
if (file_exists("{$snortdir}/preproc_rules/{$file}-sample")) { @rename("{$snortdir}/preproc_rules/{$file}-sample", "{$snortdir}/preproc_rules/{$file}"); } } /* Remove any previously installed scripts since we rebuild them */ unlink_if_exists("{$snortdir}/sid"); unlink_if_exists("{$rcdir}snort.sh"); unlink_if_exists("{$rcdir}barnyard2"); /* Create required log and db directories in /var */ safe_mkdir(SNORTLOGDIR); safe_mkdir(SNORT_IPREP_PATH); safe_mkdir(SNORT_SID_MODS_PATH); safe_mkdir(SNORT_APPID_ODP_PATH); /* If installed, absorb the Snort Dashboard Widget into this package */ /* by removing it as a separately installed package. */ $pkgid = get_pkg_id("Dashboard Widget: Snort"); if ($pkgid >= 0) { log_error(gettext("[Snort] Removing legacy 'Dashboard Widget: Snort' package because the widget is now part of the Snort package.")); unset($config['installedpackages']['package'][$pkgid]); unlink_if_exists("/usr/local/pkg/widget-snort.xml"); } /* Define a default Dashboard Widget Container for Snort */ $snort_widget_container = "snort_alerts-container:col2:close"; /*********************************************************/ /* START OF BUG FIX CODE */ /* */ /* Remove any Snort cron tasks that may have been left */ /* from a previous uninstall due to a bug that saved */ /* edited cron tasks as new ones while still leaving */ /* the original task. Correct cron task entries will */ /* be recreated below if saved settings are detected. */
</th> <?php } ?> <th><?php echo gettext("Description"); ?> </th> </tr> </thead> <tbody> <?php foreach ($pkg_keys as $key) { $index =& $pkg_info[$key]; if (get_pkg_id($index['name']) >= 0) { continue; } continue; /* get history/changelog git dir */ $commit_dir = explode("/", $index['config_file']); $changeloglink = "https://github.com/pfsense/pfsense-packages/commits/master/config/"; if ($commit_dir[count($commit_dir) - 2] == "config") { $changeloglink .= $commit_dir[count($commit_dir) - 1]; } else { $changeloglink .= $commit_dir[count($commit_dir) - 2]; } if ($menu_category != "All" && $index['category'] != $menu_category && !($menu_category == "Other" && !in_array($index['category'], $visible_categories))) { continue; } ?>
log_error("Toggle (snort stopping) for {$if_friendly}({$if_real})..."); snort_stop($snortcfg, $if_real); } else { log_error("Toggle (snort starting) for {$if_friendly}({$if_real})..."); /* set flag to rebuild interface rules before starting Snort */ $rebuild_rules = true; conf_mount_rw(); sync_snort_package_config(); conf_mount_ro(); $rebuild_rules = false; snort_start($snortcfg, $if_real); } sleep(3); // So the GUI reports correctly } $pgtitle = "Services: Snort " . SNORT_BIN_VERSION . " pkg v{$config['installedpackages']['package'][get_pkg_id("snort")]['version']}"; include_once "head.inc"; ?> <body link="#000000" vlink="#000000" alink="#000000"> <?php include_once "fbegin.inc"; /* Display Alert message */ if ($input_errors) { print_input_errors($input_errors); } if ($savemsg) { print_info_box($savemsg); } ?>
<table width="100%" border="0" cellspacing="0" cellpadding="0"> <tbody> <tr> <td class="vncellt">Squid Version</td> <td class="listr" width="75%"> <?php $pfs_version = substr(trim(file_get_contents("/etc/version")), 0, 3); $updown = is_service_running("squid") ? $img['up'] : $img['down']; $squid_path = PATH_SQUID; if ($pfs_version == "2.2") { if (is_executable($squid_path)) { preg_match("@(\\d{1}).(\\d{1}).(\\d{2})@", shell_exec("{$squid_path} -v"), $squid_version); $version = $squid_version[0]; } $version .= " (pkg v{$config['installedpackages']['package'][get_pkg_id("squid3")]['version']})"; } else { pkg_exec("query '%v' squid", $version, $err); } echo "{$updown} {$version}"; ?> </td> </tr> <tr> <td class="vncellt">Antivirus Scanner</td> <td class="listr" width="75%"> <?php echo squid_clamav_version(); ?> </td> </tr>