Ph0enixKM / Amber

💎 Amber the programming language compiled to bash
https://amber-lang.com
GNU General Public License v3.0
3.51k stars 67 forks source link

Native lockfile #223

Open Mte90 opened 1 week ago

Mte90 commented 1 week ago

So can be handy to be able to run the script just once and not multiple times together.

I am thinking like a statement that you put on top of the bash script file with a bash code like this:

LOCK_FILE=/tmp/$scriptfilename.lock
if [ -f "$LOCK_FILE" ]; then
   echo "Script is already running"
   exit
fi