blob: 600d6b2c8ae4750e1d1da8c3ae4b811453dcfe0f (
plain)
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
|
#!/bin/bash
# This script can be from cron to regularly verify that Ledger is
# sane. Such a cron entry might look like this, assuming you keep a
# recent working tree in ~/src/ledger, and that you want all of the
# temporary build products kept in /tmp:
#
# 0 0 * * * $HOME/src/ledger/run_verify.sh /tmp
#
# Note that this script should be run as root, otherwise it will be
# unable to clean up after itself (since make distcheck creates files
# owned by a different user). Also, whether on success or failure the
# build log and build products are left in the temporary directory for
# later examination if desired.
SRCDIR=$(dirname $0)
if [ -z "$SRCDIR" ]; then
SRCDIR=$(pwd)
fi
if [ -n "$1" -a -d "$1" ]; then
TMPDIR="$1"
else
TMPDIR=/tmp
fi
cd $TMPDIR || exit 1
cp -p "$SRCDIR"/verify.sh . || exit 1
(./verify.sh > verify.out 2>&1 || (cat verify.out; exit 1))
rm -f verify.sh
exit 0
|