mirror of
https://github.com/moraroy/NonSteamLaunchers-On-Steam-Deck.git
synced 2026-08-03 13:27:30 +03:00
Implement file locking in NonSteamLaunchers.sh
Add file locking to prevent multiple instances from running.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user