From f2104998747ab26fada8334b9992875ea8275ad0 Mon Sep 17 00:00:00 2001 From: JustArchi Date: Sun, 8 Oct 2017 15:08:15 +0200 Subject: [PATCH] Improve docker args --- ArchiSteamFarm/scripts/generic/ArchiSteamFarm-Service.sh | 7 ++++++- ArchiSteamFarm/scripts/generic/ArchiSteamFarm.sh | 4 ++++ Dockerfile | 2 +- Dockerfile.Service | 2 +- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/ArchiSteamFarm/scripts/generic/ArchiSteamFarm-Service.sh b/ArchiSteamFarm/scripts/generic/ArchiSteamFarm-Service.sh index 0b190f102..fe6ae2307 100755 --- a/ArchiSteamFarm/scripts/generic/ArchiSteamFarm-Service.sh +++ b/ArchiSteamFarm/scripts/generic/ArchiSteamFarm-Service.sh @@ -6,9 +6,14 @@ if [[ -z "${ASF_ARGS-}" ]]; then ASF_ARGS="" fi +for ARG in "$@"; do + ASF_ARGS+=" $ARG" +done + +# Kill underlying ASF process on shell process exit trap "trap - SIGTERM && kill -- -$$" SIGINT SIGTERM EXIT while [[ -f ArchiSteamFarm.dll ]]; do - dotnet ArchiSteamFarm.dll --service $ASF_ARGS # We will abort the script if ASF exits with an error + dotnet ArchiSteamFarm.dll $ASF_ARGS # We will abort the script if ASF exits with an error sleep 1 done diff --git a/ArchiSteamFarm/scripts/generic/ArchiSteamFarm.sh b/ArchiSteamFarm/scripts/generic/ArchiSteamFarm.sh index b06dd5b81..37adf0d12 100755 --- a/ArchiSteamFarm/scripts/generic/ArchiSteamFarm.sh +++ b/ArchiSteamFarm/scripts/generic/ArchiSteamFarm.sh @@ -6,5 +6,9 @@ if [[ -z "${ASF_ARGS-}" ]]; then ASF_ARGS="" fi +for ARG in "$@"; do + ASF_ARGS+=" $ARG" +done + # We don't need our shell anymore, just replace the current process instead of starting a new one exec dotnet ArchiSteamFarm.dll $ASF_ARGS diff --git a/Dockerfile b/Dockerfile index f538606ea..6cce6db00 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,4 +7,4 @@ RUN dotnet publish ArchiSteamFarm -c Release -o out /nologo && \ FROM microsoft/dotnet:2.0-runtime WORKDIR /app COPY --from=build-env /app/ArchiSteamFarm/out ./ -ENTRYPOINT ["./ArchiSteamFarm.sh"] +ENTRYPOINT ["./ArchiSteamFarm.sh", "--service"] diff --git a/Dockerfile.Service b/Dockerfile.Service index 87a548c24..9eb6ea8c2 100644 --- a/Dockerfile.Service +++ b/Dockerfile.Service @@ -8,4 +8,4 @@ RUN dotnet publish ArchiSteamFarm -c Release -o out /nologo && \ FROM microsoft/dotnet:2.0-runtime WORKDIR /app COPY --from=build-env /app/ArchiSteamFarm/out ./ -ENTRYPOINT ["./ArchiSteamFarm-Service.sh"] +ENTRYPOINT ["./ArchiSteamFarm-Service.sh", "--service"]