File: aide.wrapper

package info (click to toggle)
aide 0.16~a2.git20130520-3
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 2,936 kB
  • ctags: 2,129
  • sloc: ansic: 13,177; sh: 5,737; lex: 646; yacc: 285; makefile: 104
file content (40 lines) | stat: -rw-r--r-- 1,015 bytes parent folder | download | duplicates (4)
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/sh
#
# Perform update-aide.conf call before calling aide, since the autogenerated
# configuration is now the default config file

PATH="/usr/sbin:/sbin:/usr/bin:/bin"
LOCKFILE="/var/run/aide.lock"

if ! [ -x "/usr/bin/aide" ] && ! [ -x "/usr/sbin/aide" ]; then
  echo >&2 "no /usr/[s]bin/aide found, check your dependencies"
  exit 1
fi
AIDEBIN="/usr/bin/aide"
if ! [ -x "/usr/bin/aide" ]; then
  AIDEBIN="/usr/sbin/aide"
fi

if command -v dotlockfile >/dev/null 2>&1; then
  if ! dotlockfile -p -l $LOCKFILE; then
    echo >&2 "cannot obtain lock $LOCKFILE, stale lock?"
    exit 1
  fi
else
  echo >&2 "no dotlockfile binary in path, not checking for already running aide"
fi

if echo "$@" | grep -q -- '--config'; then
  echo >&2 "not updating aide configuration since manual config option was given"
else
  update-aide.conf
  CONFIG="--config /var/lib/aide/aide.conf.autogenerated"
fi
$AIDEBIN $CONFIG "$@"
RET=$?

if command -v dotlockfile >/dev/null 2>&1; then
  dotlockfile -u $LOCKFILE
fi

exit $RET