rc: cosmetic code change
[tomato.git] / release / src / router / layer7 / squish.sh
blobbed2d963666939f18b23f900a6ed2aebe1c06512
1 #!/bin/bash
3 # strip out anything but the required lines and put everything in one spot - zzz
6 if [ ! -s squished/squish-done ]; then
7 rm -rf squished
8 mkdir squished
10 for f in {protocols/*/*.pat,*.pat}; do
11 n=`basename $f`
12 [ ! -f $f ] && break
13 echo -en "Squishing: $n \r"
14 grep -v "^\s*$\|^#\|^userspace " $f > squished/$n
15 if [ `wc -l squished/$n | cut -d ' ' -f 1` -ne 2 ]; then
16 echo "error while squishing $f..."
17 exit 1
19 done
21 rm -f squished/unknown
22 echo 1 > squished/squish-done
25 echo "L7 filters squished."