Skip to content

Instantly share code, notes, and snippets.

@panaggio
Created September 18, 2018 16:50
Show Gist options
  • Save panaggio/8028947723910751343bac1b12a3301e to your computer and use it in GitHub Desktop.
Save panaggio/8028947723910751343bac1b12a3301e to your computer and use it in GitHub Desktop.
#!/bin/sh
exec 9>/tmp/lock-file
if ! flock -n 9 ; then
(>&2 echo "another instance is running";)
exit 1
fi
sleep 60
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment