Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added "steamget" to automate downloading of Steam games for any platf…
…orm.
- Loading branch information
Showing
1 changed file
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#!/bin/bash | ||
|
||
#set -x | ||
|
||
STEAMCMD=`which steamcmd` | ||
if [ "$?" == 1 ]; then | ||
echo "ERROR: don't see steamcmd in your \$PATH" 1>&2 | ||
echo 'Download/install instructions are here:' 1>&2 | ||
echo ' https://developer.valvesoftware.com/wiki/SteamCMD' 1>&2 | ||
exit 1 | ||
fi | ||
|
||
if [ -z $1 -o -z $2 ]; then | ||
echo "USAGE: $0 <steam_user> <appid> [install_path] [windows|macos|linux] [branchname] [branchpasswd]" 1>&2 | ||
echo " - defaults to the steamapp-appid-platform in cwd for install path." 1>&2 | ||
echo " - defaults to 'windows' for platform type." 1>&2 | ||
echo " - defaults to the default branch for branch name." 1>&2 | ||
echo " - defaults to no password for the branch password." 1>&2 | ||
exit 1 | ||
fi | ||
|
||
STEAMUSER="$1" | ||
APPID="$2" | ||
INSTPATH="$3" | ||
PLAT="$4" | ||
BETA="$5" | ||
BETAPASSWD="$6" | ||
|
||
if [ -z $PLAT ]; then | ||
PLAT=windows | ||
fi | ||
|
||
if [ -z $INSTPATH ]; then | ||
INSTPATH="./steamapp-$APPID-$PLAT" | ||
fi | ||
|
||
if [ ! -z $BETA ]; then | ||
BETAARGS="$BETAARGS -beta $BETA" | ||
fi | ||
|
||
if [ ! -z $BETAPASSWD ]; then | ||
BETAARGS="$BETAARGS -betapassword $BETAPASSWD" | ||
fi | ||
|
||
# You need bDepotBuilderUnbufferedReads set to zero or this fails on ZFS (which doesn't support O_DIRECT). | ||
"$STEAMCMD" +@bDepotBuilderUnbufferedReads 0 +@sSteamCmdForcePlatformType $PLAT +force_install_dir steamget +login "$STEAMUSER" +app_update "$APPID" $BETAARGS validate +quit | ||
if [ $? == 0 ]; then | ||
mv $HOME/.steam/steamcmd/steamget "$INSTPATH" | ||
fi | ||
|