Skip to content

Commit 2dd097b

Browse files
committed
Workaround for sed -i with bind mount (#4)
1 parent ba6c209 commit 2dd097b

1 file changed

Lines changed: 12 additions & 5 deletions

File tree

entrypoint.sh

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,26 @@ source ./venv/bin/activate
1212

1313
python3 AstroTuxLauncher.py install
1414

15+
# Use a temporary file to edit launcher.toml because if a bind exists sed -i
16+
# will fail. See https://unix.stackexchange.com/a/404356.
17+
TEMPFILE=$(mktemp)
18+
cp launcher.toml $TEMPFILE
19+
1520
if [[ "$DISABLE_ENCRYPTION" =~ ^([Tt][Rr][Uu][Ee]|1|[Yy][Ee][Ss])$ ]]; then
1621
echo Encryption will be disabled because DISABLE_ENCRYPTION is set.
17-
echo Check https://github.com/birdhimself/astroneer-docker?tab=readme-ov-file#configuring-clients for instructions on how to enable clients to connect to servers with encryption disabled.
18-
sed -i 's/^DisableEncryption.*/DisableEncryption = true/' launcher.toml
22+
echo Check https://github.com/birdhimself/astroneer-docker?tab=readme-ov-file#configuring-clients-if-encryption-is-disabled on how to enable clients to connect to servers with encryption disabled.
23+
sed -i 's/^DisableEncryption.*/DisableEncryption = true/' $TEMPFILE
1924
else
2025
echo Encryption will be enabled. You can safely ignore warnings related to encryption not working using Wine, this is no longer the case.
21-
sed -i 's/^DisableEncryption.*/DisableEncryption = false/' launcher.toml
26+
sed -i 's/^DisableEncryption.*/DisableEncryption = false/' $TEMPFILE
2227
fi
2328

2429
if [[ "$DEBUG" =~ ^([Tt][Rr][Uu][Ee]|1|[Yy][Ee][Ss])$ ]]; then
25-
sed -i 's/^LogDebugMessages.*/LogDebugMessages = true/' launcher.toml
30+
sed -i 's/^LogDebugMessages.*/LogDebugMessages = true/' $TEMPFILE
2631
else
27-
sed -i 's/^LogDebugMessages.*/LogDebugMessages = false/' launcher.toml
32+
sed -i 's/^LogDebugMessages.*/LogDebugMessages = false/' $TEMPFILE
2833
fi
2934

35+
cp $TEMPFILE launcher.toml
36+
3037
python3 AstroTuxLauncher.py start

0 commit comments

Comments
 (0)