This repository has been archived by the owner on Mar 4, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
doomgrader.sh
executable file
·66 lines (51 loc) · 2.89 KB
/
doomgrader.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
#!/usr/bin/env bash
set -e
# optional doomgrader config, only edit DOOMGRADER_ROOT and STEAM_PATH
DOOMGRADER_ROOT=${DOOMGRADER_ROOT:-~/doomgrader}
STEAM_PATH=${STEAM_PATH:-~/.steam/steam/steamapps/common}
# internal paths
DOWNLOAD_PATH=$DOOMGRADER_ROOT/files
DEPOTDOWNLOADER_PATH=$DOOMGRADER_ROOT/depotdownloader
# copy prompt
copy() {
echo "Copying the files from $DOWNLOAD_PATH to $STEAM_PATH/DOOMEternal/"
read -p "Overwrite the existing game files? [y]es, [n]o: " COPY_RESPONSE
if [[ $COPY_RESPONSE == 'y' ]]; then
\cp $DOWNLOAD_PATH/* $STEAM_PATH/DOOMEternal/ -rfv
elif [[ $COPY_RESPONSE != 'y' && $COPY_RESPONSE != 'n' ]]; then
echo Error: Invalid response [$COPY_RESPONSE]
copy
fi
}
# if the "-c" flag is passed, then just copy and finish
if [[ $1 == "-c" ]]; then
copy
exit 0
fi
# make doomgrader directories
mkdir -p $DOOMGRADER_ROOT $DOWNLOAD_PATH $DEPOTDOWNLOADER_PATH
# change to depotdownloader directory
pushd $DEPOTDOWNLOADER_PATH
# download depotdownloader
curl https://github.com/SteamRE/DepotDownloader/releases/download/DepotDownloader_2.3.4/depotdownloader-2.3.4.zip -o depotdownloader_2.3.4.zip -L
# extract depotdownloader
unzip depotdownloader_2.3.4.zip
# replace dotnet dependency with mono
sed -i 's/dotnet/mono/' depotdownloader
# make depotdownloader executable
chmod +x depotdownloader
# prompt for steam credentials, do not edit
IFS=$'\n' # handle spaces in passwords
read -p "Enter your Steam username:" STEAM_USERNAME
read -s -p "Enter your Steam password:" STEAM_PASSWORD
# download the depots
./depotdownloader -app 782330 -depot 782332 -manifest 4641765937586464647 -username "$STEAM_USERNAME" -password "$STEAM_PASSWORD" -remember-password -dir "$DOWNLOAD_PATH"
./depotdownloader -app 782330 -depot 782333 -manifest 4686311672633195957 -username "$STEAM_USERNAME" -password "$STEAM_PASSWORD" -remember-password -dir "$DOWNLOAD_PATH"
./depotdownloader -app 782330 -depot 782334 -manifest 2624212357815850298 -username "$STEAM_USERNAME" -password "$STEAM_PASSWORD" -remember-password -dir "$DOWNLOAD_PATH"
./depotdownloader -app 782330 -depot 782335 -manifest 8671913471625122045 -username "$STEAM_USERNAME" -password "$STEAM_PASSWORD" -remember-password -dir "$DOWNLOAD_PATH"
./depotdownloader -app 782330 -depot 782336 -manifest 4248922069342282231 -username "$STEAM_USERNAME" -password "$STEAM_PASSWORD" -remember-password -dir "$DOWNLOAD_PATH"
./depotdownloader -app 782330 -depot 782337 -manifest 122337607158713695 -username "$STEAM_USERNAME" -password "$STEAM_PASSWORD" -remember-password -dir "$DOWNLOAD_PATH"
./depotdownloader -app 782330 -depot 782338 -manifest 4899404039317730890 -username "$STEAM_USERNAME" -password "$STEAM_PASSWORD" -remember-password -dir "$DOWNLOAD_PATH"
./depotdownloader -app 782330 -depot 782339 -manifest 8937962102049582968 -username "$STEAM_USERNAME" -password "$STEAM_PASSWORD" -remember-password -dir "$DOWNLOAD_PATH"
# copy game files
copy