-
Notifications
You must be signed in to change notification settings - Fork 3
/
install.sh
64 lines (49 loc) · 1.36 KB
/
install.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
#!/bin/sh
projectname="keyframes"
echo&&echo
echo -e " \x1B[1mgithub.com/samisalreadytaken/$projectname\x1B[0m"
echo&&echo
cd ~
csgodir="${HOME%/}/.steam/steam"
checkdir()
{
csgodir="$1/steamapps/common/Counter-Strike Global Offensive/"
[ -d "$csgodir" ]
}
while true; do
checkdir "$csgodir"
if [ $? -ne 0 ]; then
echo -e "\x1B[91mERROR:\x1B[0m Could not find game directory at:"
echo " $csgodir"
echo
echo -e "Enter your Steam directory:"
echo -ne "\x1B[7m>:\x1B[0m "
read -r csgodir
echo
if [ -z "$csgodir" ]; then
break
fi
else
echo "Found game directory:"
echo " $csgodir"
echo
cd "$csgodir"
if [ -f "csgo/scripts/vscripts/benchmark.nut" ]; then
echo -e "\x1B[1mUpdating...\x1B[0m"
else
echo -e "\x1B[1mInstalling...\x1B[0m"
fi
echo -e "\x1B[90m==============================================================================="
curl -L -o "$projectname.tar.gz" "https://codeload.github.com/samisalreadytaken/$projectname/tar.gz/master"
tar -xzf "$projectname.tar.gz" --strip=1 "$projectname-master/csgo" && rm "$projectname.tar.gz"
if [ $? -ne 0 ]; then
echo
echo -e "\x1B[91mERROR\x1B[0m: Download failed."
break
fi
echo -e "===============================================================================\x1B[0m"
echo -e "\x1B[92mSuccess!\x1B[0m"
echo
break
fi
done