wolf: auto-seed Steam library config on manage.sh start
Wolf creates /etc/wolf/<id>/Steam/ session dirs when the container starts, not at install time. Previously the user had to manually run fix-perms after first start to propagate libraryfolders.vdf. manage.sh start now calls _seed_steam_library() after docker compose up, which copies libraryfolders.vdf from game storage into any Wolf session dir that doesn't have it yet — so the correct library path (/mnt/games/steam) is in place before the first Moonlight connection. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01D8ckUJQtj1pH8jtAddBDZs
This commit is contained in:
+27
-1
@@ -926,8 +926,34 @@ EOF
|
||||
# ── Management script ─────────────────────────────────────────────────────
|
||||
cat > manage.sh << 'MEOF'
|
||||
#!/bin/bash
|
||||
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||
|
||||
_seed_steam_library() {
|
||||
local game_dir
|
||||
game_dir=$(grep '^GAME_STORAGE_DIR=' "$SCRIPT_DIR/.env" 2>/dev/null | cut -d= -f2-)
|
||||
local vdf="$game_dir/steam/steamapps/libraryfolders.vdf"
|
||||
[ -f "$vdf" ] || return 0
|
||||
local changed=0
|
||||
for wdir in /etc/wolf/[0-9]*/Steam; do
|
||||
[ -d "$wdir" ] || continue
|
||||
local dest="$wdir/.local/share/Steam/steamapps/libraryfolders.vdf"
|
||||
if [ ! -f "$dest" ]; then
|
||||
sudo mkdir -p "$(dirname "$dest")"
|
||||
sudo cp "$vdf" "$dest"
|
||||
sudo chown -R 1000:1000 "$wdir"
|
||||
changed=1
|
||||
fi
|
||||
done
|
||||
[ "$changed" = 1 ] && echo "Steam library config seeded into Wolf session dir."
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start) docker compose up -d; echo "Wolf started. Pair Moonlight to this server's IP." ;;
|
||||
start)
|
||||
docker compose up -d
|
||||
echo "Wolf started. Pair Moonlight to this server's IP."
|
||||
sleep 3
|
||||
_seed_steam_library
|
||||
;;
|
||||
stop) docker compose down ;;
|
||||
restart) docker compose restart ;;
|
||||
logs) docker compose logs -f wolf ;;
|
||||
|
||||
Reference in New Issue
Block a user