Skip to content

Instantly share code, notes, and snippets.

@waffle2k
Created January 4, 2011 16:35
Show Gist options
  • Save waffle2k/764999 to your computer and use it in GitHub Desktop.
Save waffle2k/764999 to your computer and use it in GitHub Desktop.
#!/bin/bash
function die
{
echo "$1"
exit 1
}
touch /tmp/default.lck || die "Could not touch /tmp/default.lck"
perl /usr/local/bin/lock-and-process.pl '/usr/local/bin/some_script.sh' || die 'Could not get lock for /usr/local/bin/some_script.sh'
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment