Sophie

Sophie

distrib > Mageia > 3 > i586 > media > core-release-src > by-pkgid > ff6e0c816a378661c7410ceeefd0a099 > files > 2

snort-rules-2.4-6.mga3.src.rpm

#!/bin/sh
# Purges non-GPL rules from a common set

if [ -z "$1" ] ; then
    echo "Usage: $0 directory_with_rules"
fi

if [ ! -d "$1" ] ; then
    echo "ERROR: $1 is not a directory"
    exit 1
fi

for file in $1/*rules; do 
    if [ -r "$file" ] ; then
        name=`basename $file`
        if [ ! -e "$name" ] ; then
            cat $file |perl remove-non-gpl.pl >$name
        else
            echo "ERROR: Cowardly refusing to overwrite $name"
        fi
    fi
done