Skip to content

Instantly share code, notes, and snippets.

@davidlu1001
Created January 1, 2016 03:58
Show Gist options
  • Save davidlu1001/fecbf09e8e3e08b9751e to your computer and use it in GitHub Desktop.
Save davidlu1001/fecbf09e8e3e08b9751e to your computer and use it in GitHub Desktop.
avoid-script-start-duplicated.sh
Fock(){
shell_name=`basename $0`
if fuser $0 2>/dev/null |sed "s/\\<$$\\>//" |grep -q '[0-9]';then
exit 1
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment