Docker: make it possible to pass arguments

This commit is contained in:
JustArchi
2017-10-07 19:54:23 +02:00
parent 5c737a286b
commit 685e52d53f
5 changed files with 17 additions and 7 deletions

View File

@@ -2,9 +2,13 @@
set -eu
cd "$(dirname "$(readlink -f "$0")")"
if [[ -z "${ASF_ARGS-}" ]]; then
ASF_ARGS=""
fi
trap "trap - SIGTERM && kill -- -$$" SIGINT SIGTERM EXIT
while [[ -f ArchiSteamFarm.dll ]]; do
dotnet ArchiSteamFarm.dll --service # We will abort the script if ASF exits with an error
dotnet ArchiSteamFarm.dll --service $ASF_ARGS # We will abort the script if ASF exits with an error
sleep 1
done

View File

@@ -1,3 +1,3 @@
@echo off
pushd %~dp0
dotnet ArchiSteamFarm.dll
dotnet %ASF_ARGS% ArchiSteamFarm.dll

View File

@@ -1,4 +1,10 @@
#!/bin/bash
set -eu
cd "$(dirname "$(readlink -f "$0")")"
dotnet ArchiSteamFarm.dll
if [[ -z "${ASF_ARGS-}" ]]; then
ASF_ARGS=""
fi
# We don't need our shell anymore, just replace the current process instead of starting a new one
exec dotnet $ASF_ARGS ArchiSteamFarm.dll