#!/usr/bin/env bash
# One-time TF2 client download. Run this yourself (interactive Steam Guard):
#   !  bash /home/ubuntu/tf2stream/download_tf2.sh YOUR_STEAM_LOGIN
# It will prompt for password + Steam Guard code the first time.
# app 440 = Team Fortress 2 (client). TF2 is free-to-play, any account works.
set -e
BASE=/home/ubuntu/tf2stream
USER_LOGIN="${1:?usage: download_tf2.sh <steam_login_name>}"
"$BASE/steamcmd/steamcmd.sh" \
  +force_install_dir "$BASE/tf2" \
  +login "$USER_LOGIN" \
  +app_update 440 validate \
  +quit
echo "=== TF2 install dir contents ==="
ls -la "$BASE/tf2/hl2.sh" "$BASE/tf2/tf" 2>/dev/null || true
