File logdigest-all-ignores-autogeneration of Package logdigest

#!/bin/bash
#
# Concatenate the ignore files into a single file
# /etc/logdigest/ignores.autogenerated, pruned by spaces.
#
# That file can be used by other programs (e.g. eddie-tool) for 
# log-scanning.

cd /etc/logdigest || exit 0

for i in alarming ignore; do
	if ! test -e $i.local; then 
		touch $i.local
		chmod 600 $i.local
	fi
done


f=ignore.all.autogenerated
if ! test -e $f; then 
	touch $f
	chmod 600 $f
fi

touch $f.new
chmod 600 $f.new
grep -h -v "^[[:space:]]*$" ignore ignore.local > $f.new

if cmp -s $f $f.new; then
	rm $f.new
else
	mv $f.new $f

	if test -x /etc/init.d/eddie && rceddie status &>/dev/null; then
		/etc/init.d/eddie try-restart
	fi
fi
openSUSE Build Service is sponsored by