aboutsummaryrefslogtreecommitdiffstats
path: root/config/snort/snort_check_for_rule_updates.php
diff options
context:
space:
mode:
authorbmeeks8 <bmeeks8@bellsouth.net>2015-08-13 19:15:29 -0400
committerbmeeks8 <bmeeks8@bellsouth.net>2015-08-13 19:15:29 -0400
commit63151a3f2241f14677df474bc61d9b51469d84ea (patch)
tree8d78b5fb262006644e344220eba3a47adeb086c5 /config/snort/snort_check_for_rule_updates.php
parent1424f3c70d34e58543de64840d708f88e5cb8379 (diff)
downloadpfsense-packages-63151a3f2241f14677df474bc61d9b51469d84ea.tar.gz
pfsense-packages-63151a3f2241f14677df474bc61d9b51469d84ea.tar.bz2
pfsense-packages-63151a3f2241f14677df474bc61d9b51469d84ea.zip
Remove unneeded duplicate code to simplify things.
Diffstat (limited to 'config/snort/snort_check_for_rule_updates.php')
-rwxr-xr-xconfig/snort/snort_check_for_rule_updates.php17
1 files changed, 6 insertions, 11 deletions
diff --git a/config/snort/snort_check_for_rule_updates.php b/config/snort/snort_check_for_rule_updates.php
index 0c4543cd..123661e4 100755
--- a/config/snort/snort_check_for_rule_updates.php
+++ b/config/snort/snort_check_for_rule_updates.php
@@ -64,19 +64,14 @@ $openappid_detectors = $config['installedpackages']['snortglobal']['openappid_de
/* Working directory for downloaded rules tarballs and extraction */
$tmpfname = "{$g['tmp_path']}/snort_rules_up";
-/* Grab the Snort binary version programmatically and use it to construct */
-/* the proper Snort VRT rules tarball and md5 filenames. Fallback to a */
-/* default in the event we fail. */
-$snortver = array();
-exec("{$snortbindir}snort -V 2>&1 |/usr/bin/grep Version | /usr/bin/cut -c20-26", $snortver);
-// Save the version with decimal delimiters for use in extracting the rules
-$snort_version = $snortver[0];
-if (empty($snort_version))
- $snort_version = SNORT_BIN_VERSION;
+/* Use the Snort binary version to construct the proper Snort VRT */
+/* rules tarball and md5 filenames. Save the version with decimal */
+/* delimiters for use in extracting the rules. */
+$snort_version = SNORT_BIN_VERSION;
// Create a collapsed version string for use in the tarball filename
-$snortver[0] = str_replace(".", "", $snortver[0]);
-$snort_filename = "snortrules-snapshot-{$snortver[0]}.tar.gz";
+$snortver = str_replace(".", "", SNORT_BIN_VERSION);
+$snort_filename = "snortrules-snapshot-{$snortver}.tar.gz";
$snort_filename_md5 = "{$snort_filename}.md5";
$snort_rule_url = VRT_DNLD_URL;