c3e9a2
#!/bin/bash
c3e9a2
c3e9a2
if [ -e /etc/sysconfig/man-db ]; then
c3e9a2
    . /etc/sysconfig/man-db
c3e9a2
fi
c3e9a2
c3e9a2
if [ "$CRON" = "no" ]; then
c3e9a2
   exit 0
c3e9a2
fi
c3e9a2
c3e9a2
renice +19 -p $$ >/dev/null 2>&1
c3e9a2
ionice -c3 -p $$ >/dev/null 2>&1
c3e9a2
c3e9a2
LOCKFILE=/var/lock/man-db.lock
c3e9a2
c3e9a2
# the lockfile is not meant to be perfect, it's just in case the
c3e9a2
# two man-db cron scripts get run close to each other to keep
c3e9a2
# them from stepping on each other's toes.  The worst that will
c3e9a2
# happen is that they will temporarily corrupt the database
c3e9a2
[[ -f $LOCKFILE ]] && exit 0
c3e9a2
c3e9a2
trap "{ rm -f $LOCKFILE ; exit 0; }" EXIT
c3e9a2
touch $LOCKFILE
c3e9a2
# create/update the mandb database
c3e9a2
mandb $OPTS
c3e9a2
c3e9a2
exit 0