File: steamcmd.sh

package info (click to toggle)
steamcmd 0~20130205-1
  • links: PTS, VCS
  • area: non-free
  • in suites: stretch
  • size: 11,160 kB
  • ctags: 3
  • sloc: sh: 59; python: 49; makefile: 30
file content (36 lines) | stat: -rwxr-xr-x 880 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash

STEAMROOT="$(cd "${0%/*}" && echo $PWD)"
STEAMEXE=`basename "$0" .sh`

PLATFORM=linux32 # dedicated server build (minimal dependencies)

# prepend our lib path to LD_LIBRARY_PATH
export LD_LIBRARY_PATH="$STEAMROOT/$PLATFORM:$LD_LIBRARY_PATH"

ulimit -n 2048

MAGIC_RESTART_EXITCODE=42

# and launch steam
if [ "$DEBUGGER" == "gdb" ] || [ "$DEBUGGER" == "cgdb" ]; then
	ARGSFILE=$(mktemp $USER.steam.gdb.XXXX)

	# Set the LD_PRELOAD varname in the debugger, and unset the global version. 
	if [ "$LD_PRELOAD" ]; then
		echo set env LD_PRELOAD=$LD_PRELOAD >> "$ARGSFILE"
		echo show env LD_PRELOAD >> "$ARGSFILE"
		unset LD_PRELOAD
	fi

	$DEBUGGER -x "$ARGSFILE" "$STEAMROOT/$PLATFORM/$STEAMEXE" "$@"
	rm "$ARGSFILE"
else
	$DEBUGGER "$STEAMROOT/$PLATFORM/$STEAMEXE" "$@"
fi
STATUS=$?

if [ $STATUS -eq $MAGIC_RESTART_EXITCODE ]; then
    exec "$0" "$@"
fi
exit $STATUS