summaryrefslogtreecommitdiff
path: root/localintegritupdate
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2003-06-15 10:26:28 +0000
committerJonas Smedegaard <dr@jones.dk>2003-06-15 10:26:28 +0000
commit46bc7c1d19056750c87e97f91905de0681e6e62b (patch)
tree3a4d8a851f97ea7b42a6df862b16fae1da78ab53 /localintegritupdate
parent16beebdedcab715dedb0196d848eccaf61449c77 (diff)
New script localintegritupdate to run after aptitude update.
Diffstat (limited to 'localintegritupdate')
-rwxr-xr-xlocalintegritupdate34
1 files changed, 34 insertions, 0 deletions
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