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
PID=$(pidof -x $0 -o $$)
if [ $? -eq 0 ]
then
    echo "Already running ($PID)"
    exit 1
fi