File: cron.daily

package info (click to toggle)
chkrootkit 0.48-8
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 448 kB
  • ctags: 221
  • sloc: sh: 3,174; ansic: 1,474; makefile: 88
file content (26 lines) | stat: -rw-r--r-- 576 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/sh -e

CHKROOTKIT=/usr/sbin/chkrootkit
CF=/etc/chkrootkit.conf
LOG_DIR=/var/cache/chkrootkit

if [ ! -x $CHKROOTKIT ]; then
  exit 0
fi

if [ -f $CF ]; then
    . $CF
fi

if [ "$RUN_DAILY" = "true" ]; then
    if [ "$DIFF_MODE" = "true" ]; then
        $CHKROOTKIT $RUN_DAILY_OPTS > $LOG_DIR/log.new 2>&1
        if [ ! -f $LOG_DIR/log.old ] \
           || ! diff -q $LOG_DIR/log.old $LOG_DIR/log.new > /dev/null 2>&1; then
            cat $LOG_DIR/log.new
        fi
        mv $LOG_DIR/log.new $LOG_DIR/log.old
    else
        $CHKROOTKIT $RUN_DAILY_OPTS
    fi
fi