Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace the complicated sed regexp with a simpler one and correct the…
… sed cmd invocation. The trick is to find the line with an address expression, the rest is pretty generic. To test the approach copy a few lines from a rules file and call from the php-cli: <?php // Expression test for php or php-cli // comment out expression $sedcmd = '/^alert.*classtype:sdf/s/^/#/'; file_put_contents('comment.sed', $sedcmd); // uncomment expression $sedcmd = '/^#alert.*classtype:sdf/s/^#//'; file_put_contents('uncomment.sed', $sedcmd); // call sed to comment and uncomment exec("sed -f comment.sed test.rules > test-co.rules"); exec("sed -f uncomment.sed test-co.rules > test-uc.rules"); // perform a quick check: test.rules should be identical to test-uc.rules exec("diff -u test.rules test-uc.rules > delta"); $delta = file_get_contents('delta'); unlink('delta'); echo "\n$delta\n"; ?>
- Loading branch information
33cf128
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
aaronritter is most likely right, because after searching the net I found others had exactly the same problem because classification.config was not up to date.
33cf128
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
....
see: http://forum.pfsense.org/index.php/topic,51493.msg275905.html#msg275905