Bash#!/bin/shif [ -f /tmp/.my-lock ] then exit 0fitouch /tmp/.my-lock # Выполняем скрипт# ... rm /tmp/.my-lock