mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2026-01-14 07:30:39 +00:00
Handle chmod +x for generic helper scripts
This commit is contained in:
@@ -11,8 +11,9 @@ ASF_ARGS+=" $*"
|
||||
# Kill underlying ASF process on shell process exit
|
||||
trap "trap - SIGTERM && kill -- -$$" SIGINT SIGTERM EXIT
|
||||
|
||||
while [[ -f ArchiSteamFarm.dll ]]; do
|
||||
dotnet ArchiSteamFarm.dll $ASF_ARGS &
|
||||
while :; do
|
||||
dotnet ArchiSteamFarm.dll $ASF_ARGS & # We need to start ASF in the background for trap to work
|
||||
wait $! # This will forward dotnet error code, set -e will abort the script if it's non-zero
|
||||
chmod +x "$0" # If ASF exited by itself, we need to ensure that our script is still set to +x after auto-update
|
||||
sleep 1
|
||||
done
|
||||
|
||||
@@ -8,5 +8,9 @@ fi
|
||||
|
||||
ASF_ARGS+=" $*"
|
||||
|
||||
# We don't need our shell anymore, just replace the current process instead of starting a new one
|
||||
exec dotnet ArchiSteamFarm.dll $ASF_ARGS
|
||||
# Kill underlying ASF process on shell process exit
|
||||
trap "trap - SIGTERM && kill -- -$$" SIGINT SIGTERM EXIT
|
||||
|
||||
dotnet ArchiSteamFarm.dll $ASF_ARGS & # We need to start ASF in the background for trap to work
|
||||
wait $! # This will forward dotnet error code, set -e will abort the script if it's non-zero
|
||||
chmod +x "$0" # If ASF exited by itself, we need to ensure that our script is still set to +x after auto-update
|
||||
|
||||
Reference in New Issue
Block a user