One other way to make sure a single instance of bash script runs:
#! /bin/bash -
# Check if another instance of script is running
if pidof -o %PPID -x $0-- "$0" >/dev/nullnull; &&then
echo printf >&2 '%s\n' "ERROR: Script $0 already running"
&& exit 1
fi
...
pidof -o %PPID -x $0-- "$0" gets the PID of the existing scriptscript¹ if itsit's already running or exits with error code 1 if no other script is running
¹ Well, any process with the same name...