Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37813734
en ru br
ALT Linux repos
S:2.9.9.0-alt1
5.0: 2.4.5-alt1
4.1: 2.4.5-alt1
4.0: 2.4.5-alt1

Group :: Security/Networking
RPM: snort-rules

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

#!/bin/sh
#
# snort-mergesidmaps
#
# Create single list of Snort SID's from multiple sources.
# Written at Nov 2005 by evseev@altlinux.org
#

# These files are created in the current directory
DEST_STAMP="sid"
DEST_FNAME="sid-msg.map"
# These files are used for processing when command line contain no filenames
SOURCES_FMASK="sid-msg*.map*"

main()
{
local sources= old_exists= dest_fname=$DEST_FNAME
if [ $# = 0 ]; then
sources=$(eval echo $SOURCES_FMASK)
if [ "$sources" = "$SOURCES_FMASK" ]; then
echo "Cannot find source maps $SOURCES_FMASK, stopped."
return 1
fi
fi
for f in "$@" $sources; do
[ $f = "$DEST_FNAME" ] || continue
old_exists=1
break;
done
[ -n "$old_exists" ] && dest_fname=$dest_fname.new
cat "$@" $sources | egrep '^[0-9]+ \|\| ' | sort -n | uniq --check-chars=12 > $dest_fname
if [ "$dest_fname" != "$DEST_FNAME" ]; then
cat $dest_fname > $DEST_FNAME
/bin/rm $dest_fname
fi
local last_line=$(tail -1 $DEST_FNAME)
echo ${last_line%% *} > $DEST_STAMP
}

main "$@"

## EOF ##
 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin