diff options
author | Warren Baker <warren@decoy.co.za> | 2012-08-13 18:54:56 +0200 |
---|---|---|
committer | Warren Baker <warren@decoy.co.za> | 2012-08-13 18:54:56 +0200 |
commit | 8c4ac1103da341d76ff45532b87db039d77c7ac3 (patch) | |
tree | a5da8d64e1434774ba4aa1117dd50529b7f736b6 | |
parent | 36d1c79884640deb7b1032b395d6b7092a690ea5 (diff) | |
download | pfsense-8c4ac1103da341d76ff45532b87db039d77c7ac3.zip pfsense-8c4ac1103da341d76ff45532b87db039d77c7ac3.tar.gz |
Remove comments which may begin with a ';' so URL Table entries like SpamHaus' drop list can be used
-rw-r--r-- | etc/inc/pfsense-utils.inc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc index 59522f1..78a0183 100644 --- a/etc/inc/pfsense-utils.inc +++ b/etc/inc/pfsense-utils.inc @@ -2001,7 +2001,7 @@ function process_alias_urltable($name, $url, $freq, $forceupdate=false) { mwexec("/usr/bin/fetch -T 5 -q -o " . escapeshellarg($urltable_filename . ".tmp") . " " . escapeshellarg($url)); // Remove comments. Might need some grep-fu to only allow lines that look like IPs/subnets if (file_exists($urltable_filename . ".tmp")) { - mwexec("/usr/bin/grep -v '^#' " . escapeshellarg($urltable_filename . ".tmp") . " > " . escapeshellarg($urltable_filename)); + mwexec("/usr/bin/sed 's/\;.*//g' ". escapeshellarg($urltable_filename . ".tmp") . "| /usr/bin/egrep -v '^[[:space:]]*$|^#' > " . escapeshellarg($urltable_filename)); unlink_if_exists($urltable_filename . ".tmp"); } else mwexec("/usr/bin/touch {$urltable_filename}"); |