forked from game-ci/steam-deploy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsteam_deploy.sh
executable file
·67 lines (54 loc) · 1.51 KB
/
steam_deploy.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/bin/bash
set -euo pipefail
IFS=$'\n\t'
steamdir=${STEAM_HOME:-$HOME/Steam}
# this is relative to the action
contentroot=$(pwd)/$rootPath
if [ -n "$steam_totp" ]; then
echo ""
echo "#################################"
echo "# Using SteamGuard TOTP #"
echo "#################################"
echo ""
else
if [ ! -n "$configVdf" ]; then
echo "Config VDF input is missing or incomplete! Cannot proceed."
exit 1
fi
steam_totp="INVALID"
echo ""
echo "#################################"
echo "# Copying SteamGuard Files #"
echo "#################################"
echo ""
echo "Steam is installed in: $steamdir"
mkdir -p "$steamdir/config"
echo "Copying $steamdir/config/config.vdf..."
echo "$configVdf" | base64 -d > "$steamdir/config/config.vdf"
chmod 777 "$steamdir/config/config.vdf"
echo "Finished Copying SteamGuard Files!"
echo ""
fi
echo ""
echo "#################################"
echo "# Test login #"
echo "#################################"
echo ""
steamcmd +set_steam_guard_code "$steam_totp" +login "$steam_username" +quit;
ret=$?
if [ $ret -eq 0 ]; then
echo ""
echo "#################################"
echo "# Successful login #"
echo "#################################"
echo ""
else
echo ""
echo "#################################"
echo "# FAILED login #"
echo "#################################"
echo ""
echo "Exit code: $ret"
exit $ret
fi
exit 1