-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathas-user.sh
executable file
·39 lines (36 loc) · 1.17 KB
/
as-user.sh
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
37
38
39
#!/bin/bash
# Install steamcmd
mkdir -p .steam/sdk32/
ln -s ~/linux32/steamclient.so ~/.steam/sdk32/steamclient.so
curl https://media.steampowered.com/installer/steamcmd_linux.tar.gz | tar -xzvf -
# Convenient symlinks for mount points
if [ "${INSTALL_DIR}" = "l4d2" ]; then
GAME_DIR="${INSTALL_DIR}/left4dead2"
elif [ "${INSTALL_DIR}" = "l4d" ]; then
GAME_DIR="${INSTALL_DIR}/left4dead"
else
exit 100
fi
mkdir -p ./"${GAME_DIR}"
ln -s /addons "./${GAME_DIR}/addons"
ln -s /cfg "./${GAME_DIR}/cfg"
ln -s /motd/host.txt "./${GAME_DIR}/myhost.txt"
ln -s /motd/motd.txt "./${GAME_DIR}/mymotd.txt"
# Install game
echo """force_install_dir "/home/louis/${INSTALL_DIR}"
login anonymous
app_update ${GAME_ID}
quit""" > update.txt
if [ "${INSTALL_DIR}" = "l4d2" ]; then
# https://github.com/ValveSoftware/steam-for-linux/issues/11522
echo """force_install_dir "/home/louis/${INSTALL_DIR}"
login anonymous
@sSteamCmdForcePlatformType windows
app_update ${GAME_ID}
@sSteamCmdForcePlatformType linux
app_update ${GAME_ID} validate
quit""" > first-install-l4d2.txt
./steamcmd.sh +runscript first-install-l4d2.txt
else
./steamcmd.sh +runscript update.txt
fi