[vox-tech] simple stupid lockfile example?
Mike Simons
vox-tech@lists.lugod.org
Tue, 18 Mar 2003 04:09:53 -0500
On Tue, Mar 18, 2003 at 12:58:01AM -0800, Bill Kendrick wrote:
> i want to replace 'tin' with a shell script or alias that will
> test for a lock file (and call me a moron if it exists), make a lock file,
> run tin, and then delete the lock file...
=====
#! /bin/bash
LOCK=$HOME/.tin.lock
lockfile $LOCK
tin
rm -f $LOCK
=====
"lockfile" is part of the procmail package.
if you ^C the script, you will have to clean up and delete the lockfile
on your own. there are a few ways for the script to automatically
detect tin was killed, but you didn't ask for that. ;)