Add awful workaround for #1812

This commit is contained in:
JustArchi 2020-06-05 17:30:03 +02:00
parent a8a05fc4c0
commit 28ebc497d8
3 changed files with 66 additions and 0 deletions

View file

@ -62,6 +62,28 @@ CONFIG_PATH="$(pwd)/${CONFIG_PATH}"
# Kill underlying ASF process on shell process exit
trap "trap - TERM && kill -- -$$" INT TERM
# TODO: Workaround for https://github.com/JustArchiNET/ArchiSteamFarm/issues/1812
if [ -n "${DOTNET_RUNNING_IN_CONTAINER-}" ] && [ "$DOTNET_RUNNING_IN_CONTAINER" = "true" ]; then
(
loops=6 # Maximum of 60 seconds for unpack
while [ "$loops" -gt 0 ]; do
sleep 10
if [ -d "/var/tmp/.net/ArchiSteamFarm" ]; then
find "/var/tmp/.net/ArchiSteamFarm" -mindepth 2 -maxdepth 2 -name '*\\*' | while IFS="" read -r broken_path; do
fixed_path="$(echo "$broken_path" | sed 's/\\/\//g')"
mkdir -p "$(dirname "$fixed_path")"
mv "$broken_path" "$fixed_path"
done
fi
loops="$((loops-1))"
done
) &
fi
while :; do
if [ -f "$CONFIG_PATH" ] && grep -Eq '"Headless":\s+?true' "$CONFIG_PATH"; then
# We're running ASF in headless mode so we don't need STDIN

View file

@ -62,6 +62,28 @@ CONFIG_PATH="$(pwd)/${CONFIG_PATH}"
# Kill underlying ASF process on shell process exit
trap "trap - TERM && kill -- -$$" INT TERM
# TODO: Workaround for https://github.com/JustArchiNET/ArchiSteamFarm/issues/1812
if [ -n "${DOTNET_RUNNING_IN_CONTAINER-}" ] && [ "$DOTNET_RUNNING_IN_CONTAINER" = "true" ]; then
(
loops=6 # Maximum of 60 seconds for unpack
while [ "$loops" -gt 0 ]; do
sleep 10
if [ -d "/var/tmp/.net/ArchiSteamFarm" ]; then
find "/var/tmp/.net/ArchiSteamFarm" -mindepth 2 -maxdepth 2 -name '*\\*' | while IFS="" read -r broken_path; do
fixed_path="$(echo "$broken_path" | sed 's/\\/\//g')"
mkdir -p "$(dirname "$fixed_path")"
mv "$broken_path" "$fixed_path"
done
fi
loops="$((loops-1))"
done
) &
fi
while :; do
if [ -f "$CONFIG_PATH" ] && grep -Eq '"Headless":\s+?true' "$CONFIG_PATH"; then
# We're running ASF in headless mode so we don't need STDIN

View file

@ -62,6 +62,28 @@ CONFIG_PATH="$(pwd)/${CONFIG_PATH}"
# Kill underlying ASF process on shell process exit
trap "trap - TERM && kill -- -$$" INT TERM
# TODO: Workaround for https://github.com/JustArchiNET/ArchiSteamFarm/issues/1812
if [ -n "${DOTNET_RUNNING_IN_CONTAINER-}" ] && [ "$DOTNET_RUNNING_IN_CONTAINER" = "true" ]; then
(
loops=6 # Maximum of 60 seconds for unpack
while [ "$loops" -gt 0 ]; do
sleep 10
if [ -d "/var/tmp/.net/ArchiSteamFarm" ]; then
find "/var/tmp/.net/ArchiSteamFarm" -mindepth 2 -maxdepth 2 -name '*\\*' | while IFS="" read -r broken_path; do
fixed_path="$(echo "$broken_path" | sed 's/\\/\//g')"
mkdir -p "$(dirname "$fixed_path")"
mv "$broken_path" "$fixed_path"
done
fi
loops="$((loops-1))"
done
) &
fi
while :; do
if [ -f "$CONFIG_PATH" ] && grep -Eq '"Headless":\s+?true' "$CONFIG_PATH"; then
# We're running ASF in headless mode so we don't need STDIN