From 46bc7c1d19056750c87e97f91905de0681e6e62b Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Sun, 15 Jun 2003 10:26:28 +0000 Subject: New script localintegritupdate to run after aptitude update. --- localintegritupdate | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100755 localintegritupdate (limited to 'localintegritupdate') diff --git a/localintegritupdate b/localintegritupdate new file mode 100755 index 0000000..be1b3c8 --- /dev/null +++ b/localintegritupdate @@ -0,0 +1,34 @@ +#!/bin/sh + +# /etc/cron.daily/localintegritupdate : update integrit db +# initially written by Andras Bali (as a cron job) + +SAVECYCLE=3 + +test -x /usr/sbin/integrit || exit 0 +test -x /usr/bin/savelog || exit 0 +test -f /etc/integrit/integrit.debian.conf || exit 0 +CONFIGS="" +. /etc/integrit/integrit.debian.conf +test -n "$CONFIGS" || exit 0 + +for config in $CONFIGS; do + known=$(egrep '^ *known *= *.+' $config | sed 's/^ *known *= *\(.\+\)$/\1/') + current=$(egrep '^ *current *= *.+' $config | sed 's/^ *current *= *\(.\+\)$/\1/') + options="-cu" + if [ ! -f "$known" ]; then + if [ -f "$current" ]; then + mv "$current" "$known" + else + options="-u" + fi + else + if [ -f "$current" ]; then + savelog -m 640 -u root -g root -c $SAVECYCLE "$known" > /dev/null + mv "$current" "$known" + fi + fi + +# nice integrit -C $config -cu 2>&1 + nice integrit -C $config $options +done -- cgit v1.2.3