#!/bin/bash
LOCKFILE=/var/lock/makewhatis.lock

# Previous makewhatis should execute successfully:
[ -f $LOCKFILE ] && exit 0

[...]
touch $LOCKFILE
makewhatis -u -w
exit 0
