I have a bash script runner.sh
which invokes another script.sh
. script.sh
is invoked only from runner.sh
. I can have only one instance of script.sh
executing at a time. If multiple invocations of runner.sh
is made then runner.sh
should make all the caller's wait if script.sh
is already running. Once script.sh
is completed then it will allow one of the waiting callers to execute script.sh
.
Can someone suggest some ways of achieving this?