|
103 | 103 | explain "Allow X11 connection from local host" |
104 | 104 | perform xhost +local:host |
105 | 105 |
|
106 | | -explain "Running Steam!" |
107 | | - |
108 | 106 | 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 | + |
110 | 121 | 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" |
114 | 124 |
|
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" |
117 | 129 | fi |
118 | 130 |
|
| 131 | +explain "Running Steam!" |
119 | 132 | perform docker run -d --rm -u 1000:1000 \ |
120 | 133 | --name steam \ |
121 | 134 | --device /dev/dri \ |
|
0 commit comments