linux bash check if program running code example
Example: bash check if process is running by name
if pgrep -x "<PROCESS_NAME>" > /dev/null; then
echo "Running"
else
echo "Not running"
fi
if pgrep -x "<PROCESS_NAME>" > /dev/null; then
echo "Running"
else
echo "Not running"
fi