Implement file locking in NonSteamLaunchers.sh

Add file locking to prevent multiple instances from running.
This commit is contained in:
Roy
2026-06-13 04:05:10 -07:00
committed by GitHub
parent def0a81c6b
commit 65e2ac882f
+6
View File
@@ -1,4 +1,10 @@
#!/usr/bin/env bash
LOCK_FILE="/tmp/nonsteamlaunchers.lock"
exec 200>"$LOCK_FILE"
flock -n 200 || {
echo "Another instance is already running. Exiting."
exit 0
}
set -x # activate debugging (execution shown)
set -o pipefail # capture error from pipes