You could have the shell script check the system process list for a duplicate instance of itself using something like...
if [ `ps -ef | grep -c ${0}` -gt 1 ]; then
echo "Previous instance of ${0} still running."
exit 1
fi
...this will display the sample error message and stop the new...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.