Skip to content

Commit df1cee9

Browse files
committed
Remove /init.sh script
Signed-off-by: Paweł Gronowski <me@woland.xyz>
1 parent a539456 commit df1cee9

2 files changed

Lines changed: 21 additions & 14 deletions

File tree

init.sh

Lines changed: 0 additions & 6 deletions
This file was deleted.

sind

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -103,19 +103,32 @@ fi
103103
explain "Allow X11 connection from local host"
104104
perform xhost +local:host
105105

106-
explain "Running Steam!"
107-
108106
saves=()
109-
ctrShare="/home/ubuntu/.local/share"
107+
initScript="#!/bin/sh"
108+
function addSavePath() {
109+
local game="$1"
110+
local ctrSharePath="$2"
111+
112+
local hostPath="$SAVES_PATH/Civ6"
113+
if [ -d "$hostPath" ]; then
114+
local ctrPath="/home/ubuntu/.local/share/$ctrSharePath"
115+
saves+=( "--mount" "type=bind,src=$hostPath,dst=$ctrPath" )
116+
initScript+="
117+
mkdir -p \"$ctrPath\""
118+
fi
119+
}
120+
110121
if [ -d "$SAVES_PATH" ]; then
111-
perform docker run --rm \
112-
"--mount=type=volume,dst=/home/ubuntu,volume-driver=local,volume-opt=device=$loopdev,volume-opt=type=ext4" \
113-
vlnd/steam /init.sh
122+
addSavePath "Civ6" "Steam/steamapps/compatdata/289070/pfx/drive_c/users/steamuser/Documents/My Games/Sid Meier's Civilization VI/Saves"
123+
addSavePath "Civ6" "aspyr-media/Sid Meier's Civilization VI/Saves"
114124

115-
saves+=( "-v" "$SAVES_PATH/Civ6:$ctrShare/Steam/steamapps/compatdata/289070/pfx/drive_c/users/steamuser/Documents/My Games/Sid Meier's Civilization VI/Saves" )
116-
saves+=( "-v" "$SAVES_PATH/Civ6:$ctrShare/aspyr-media/Sid Meier's Civilization VI/Saves" )
125+
explain "Init non-root directories"
126+
perform docker run --rm -u 1000:1000 \
127+
"--mount=type=volume,dst=/home/ubuntu,volume-driver=local,volume-opt=device=$loopdev,volume-opt=type=ext4" \
128+
alpine sh -c "$initScript"
117129
fi
118130

131+
explain "Running Steam!"
119132
perform docker run -d --rm -u 1000:1000 \
120133
--name steam \
121134
--device /dev/dri \

0 commit comments

Comments
 (0)