themactep.com

A home of miscellaneous projects by Paul Philippov.

Notes

How to check is another copy of the script is already running

PID=$(pidof -x $0 -o $$)
if [ $? -eq 0 ]
then
    echo "Already running ($PID)"
    exit 1
fi