-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathentrypoint.sh
More file actions
executable file
·53 lines (39 loc) · 1.71 KB
/
entrypoint.sh
File metadata and controls
executable file
·53 lines (39 loc) · 1.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/bin/bash
cd /astrotux
if [[ "$FORCE_CHOWN" =~ ^([Tt][Rr][Uu][Ee]|1|[Yy][Ee][Ss])$ ]]; then
echo Force chowning /astrotux folder.
chown -R $(id -u):$(id -g) /astrotux
echo Done chowning.
fi
source ./venv/bin/activate
if [[ "$CREATE_LAUNCHER_CONFIG" =~ ^(true|1|yes])$ ]] || [[ ! -f "/astrotux/launcher.toml" ]]; then
python3 AstroTuxLauncher.py genconfig
fi
# Use a temporary file to edit launcher.toml because if a bind exists sed -i
# will fail. See https://unix.stackexchange.com/a/404356.
TEMPFILE=$(mktemp)
cp launcher.toml $TEMPFILE
shopt -s nocasematch
sed -i 's/OverrideWinePath.*/OverrideWinePath = "\/opt\/wine\/bin\/wine"/' $TEMPFILE
if [ -f /usr/local/bin/box64 ]; then
sed -i 's/WrapperPath.*/WrapperPath = "\/usr\/local\/bin\/box64"/' $TEMPFILE
fi
if [[ "$DISABLE_ENCRYPTION" =~ ^(true|1|yes])$ ]]; then
echo Encryption will be disabled because DISABLE_ENCRYPTION is set.
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.
sed -i 's/^DisableEncryption.*/DisableEncryption = true/' $TEMPFILE
else
echo Encryption will be enabled. You can safely ignore warnings related to encryption not working using Wine, this is no longer the case.
sed -i 's/^DisableEncryption.*/DisableEncryption = false/' $TEMPFILE
fi
if [[ "$DEBUG" =~ ^(true|1|yes)$ ]]; then
export BOX64_LOG=1
sed -i 's/^LogDebugMessages.*/LogDebugMessages = true/' $TEMPFILE
else
export BOX64_LOG=0
sed -i 's/^LogDebugMessages.*/LogDebugMessages = false/' $TEMPFILE
fi
shopt -u nocasematch
cp $TEMPFILE launcher.toml
python3 AstroTuxLauncher.py install
python3 AstroTuxLauncher.py start