make getpeername() return the original socket address which before it was intercepted
[hband-tools.git] / user-tools / singleinstance
blob03bf9d7f3483297715e9b27ad10204a9bcd0c42b
1 #!/bin/sh
3 if [ $# -lt 2 ]
4 then
5 echo "Usage: singleinstance <LOCKFILE> <COMMAND> [<ARGS>]" >&2
6 exit 1
7 fi
9 set -e
11 lockpidfile=$1
12 shift
14 exec flock --exclusive --nonblock --no-fork "$lockpidfile" withpidfile "$lockpidfile" "$@"