forked from Parkeymon/EXILED-SCP-SL-egg
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathscript.sh
More file actions
145 lines (117 loc) · 5.79 KB
/
Copy pathscript.sh
File metadata and controls
145 lines (117 loc) · 5.79 KB
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
#!/bin/bash
# steamcmd Base Installation Script
#
# Server Files: /mnt/server
echo "
$(tput setaf 4) ____________________________ ______________
$(tput setaf 4) / _____/\_ ___ \______ \ /\ / _____/| |
$(tput setaf 4) \_____ \ / \ \/| ___/ \/ \_____ \ | |
$(tput setaf 4) / || \___| | /\ / \| |___
$(tput setaf 4)/_________/ \________/____| \/ /_________/|________|
$(tput setaf 1) ___ __ __ __
$(tput setaf 1)| | ____ _______/ |______ | | | | ___________
$(tput setaf 1)| |/ \ / ___/\ __\__ \ | | | | _/ __ \_ __ |
$(tput setaf 1)| | | |\___ \ | | / __ \| |_| |_\ ___/| | \/
$(tput setaf 1)|___|___|__/______| |__| (______|____|____/\___ |__|
$(tput sgr0)
"
echo "
$(tput setaf 2)This installer was created by $(tput setaf 1)Parkeymon$(tput setaf 2) and maintained by $(tput setaf 6)EsserGaming$(tput setaf 2).$(tput sgr0)
"
# Egg version checking, do not touch!
currentVersion="4.0.1"
latestVersion=$(curl --silent "https://api.github.com/repos/EsserGaming/scpsl-egg/releases/latest" | jq -r .tag_name)
if [ "${currentVersion}" == "${latestVersion}" ]; then
echo "$(tput setaf 2)Installer is up to date"
else
echo "
$(tput setaf 1)THE INSTALLER IS NOT UP TO DATE!
Current Version: $(tput setaf 1)${currentVersion}
Latest: $(tput setaf 2)${latestVersion}
$(tput setaf 3)Please update to the latest version found here: https://github.com/EsserGaming/scpsl-egg/releases/latest
$(tput setaf 4)Installation will start in 3 seconds...
"
sleep 3
fi
# Download SteamDepotDownloader and install it.
cd /tmp || {
echo "$(tput setaf 1) FAILED TO MOUNT TO /TMP"
exit
}
mkdir -p /mnt/server/.DepotDownloader
curl -sSL -o DepotDownloader-linux-x64.zip https://github.com/SteamRE/DepotDownloader/releases/latest/download/DepotDownloader-linux-x64.zip
unzip -oq DepotDownloader-linux-x64.zip -d /mnt/server/.DepotDownloader
cd /mnt/server/.DepotDownloader || {
echo "$(tput setaf 1) FAILED TO MOUNT TO /mnt/server/.DepotDownloader"
exit
}
# Install SCP: Secret Laboratory using SteamDepotDownloader
chown -R root:root /mnt
export HOME=/mnt/server
if [ "${BRANCH_TAG}" == "" ]; then
echo "$(tput setaf 4)Installing SCP:SL..$(tput sgr0)"
./DepotDownloader -app 996560 -depot 996562 -dir /mnt/server -validate > /dev/null # silence output
echo "$(tput setaf 2)Done.$(tput sgr0)"
else
echo "$(tput setaf 4)Installing SCP:SL $(tput bold)on custom branch (output enabled)..$(tput sgr0)"
./DepotDownloader -app 996560 -depot 996562 -branch ${BRANCH_TAG} -dir /mnt/server -validate # keeping this normal if debugging is needed
fi
# Exit if /mnt/server doesn't exist
cd /mnt/server || {
echo "$(tput setaf 1) FAILED TO MOUNT TO /mnt/server"
exit
}
# Ensure permissions are correct
chmod +x LocalAdmin SCPSL.x86_64
#Install SCPDiscord Bot
if [ "${INSTALL_SCPDBOT}" == "true" ]; then
mkdir -p /mnt/server/.egg/SCPDBot
# Remove old SCPDiscord bot
rm /mnt/server/.egg/SCPDBot/scpdiscord >/dev/null 2>&1
echo "$(tput setaf 5)Installing latest SCPDiscord Bot."
wget -q https://github.com/KarlOfDuty/SCPDiscord/releases/latest/download/scpdiscord -P /mnt/server/.egg/SCPDBot
chmod +x /mnt/server/.egg/SCPDBot/scpdiscord
else
echo $(tput setaf 3)"Skipping SCPDiscord Bot install."$(tput sgr0)
fi
#Install SCPDiscord Plugin
if [ "${INSTALL_SCPDPLUGIN}" == "true" ]; then
rm '/mnt/server/.config/SCP Secret Laboratory/LabAPI/plugins/global/SCPDiscord.dll' >/dev/null 2>&1
echo "$(tput setaf 5)Installing SCPDiscord Plugin."
echo "$(tput setaf 5)SCPDiscord: Grabbing plugin and dependencies.."
wget -q https://github.com/KarlOfDuty/SCPDiscord/releases/latest/download/dependencies.zip -P '/mnt/server/.config/SCP Secret Laboratory/LabAPI/dependencies/global'
wget -q https://github.com/KarlOfDuty/SCPDiscord/releases/latest/download/SCPDiscord.dll -P '/mnt/server/.config/SCP Secret Laboratory/LabAPI/plugins/global'
echo "$(tput setaf 5)SCPDiscord: Extracting dependencies.."
unzip -oq '/mnt/server/.config/SCP Secret Laboratory/LabAPI/dependencies/global/dependencies.zip' -d '/mnt/server/.config/SCP Secret Laboratory/LabAPI/dependencies/global/'
rm '/mnt/server/.config/SCP Secret Laboratory/LabAPI/dependencies/global/dependencies.zip' >/dev/null 2>&1
else
echo $(tput setaf 3)"Skipping SCPDiscord Plugin install."$(tput sgr0)
fi
# EXILED installation
if [[ "${INSTALL_EXILED}" == "true" ]]; then
echo "$(tput setaf 4)Downloading $(tput setaf 1)EXILED $(tput setaf 4)installer."
mkdir -p .config/
rm Exiled.Installer-Linux >/dev/null 2>&1
wget -q https://github.com/ExMod-Team/EXILED/releases/latest/download/Exiled.Installer-Linux
chmod +x ./Exiled.Installer-Linux
if [[ "${EXILED_PRE}" == "true" ]]; then
echo "$(tput setaf 4)Installing latest $(tput setaf 1)EXILED $(tput setaf 4)pre-release.."
./Exiled.Installer-Linux -p /mnt/server/ --pre-releases >/dev/null
elif [[ "${EXILED_PRE}" == "false" ]]; then
echo "$(tput setaf 4)Installing latest $(tput setaf 1)EXILED $(tput setaf 4)release.."
./Exiled.Installer-Linux -p /mnt/server/ --skip-version-select >/dev/null
else
echo "$(tput setaf 4)Installing $(tput setaf 1)EXILED$ $(tput setaf 4)version: $(tput bold)$(tput setaf 1)${EXILED_PRE}$(tput sgr0)"
./Exiled.Installer-Linux -p /mnt/server/ --target-version "${EXILED_PRE}" # un-silenced in case debugging is needed
fi
else
echo $(tput setaf 3)"Skipping Exiled installation."$(tput sgr0)
fi
# Cleanup, I also silenced rm if it doesn't find the file.
echo "$(tput setaf 5)Cleaning up..$(tput sgr 0)"
rm /mnt/server/core >/dev/null 2>&1
rm /mnt/server/Exiled.Installer-Linux >/dev/null 2>&1
rm /mnt/server/config-gameplay.txt >/dev/null 2>&1
rm -r /mnt/server/? >/dev/null 2>&1
rm -r /mnt/server/.local >/dev/null 2>&1
echo "$(tput setaf 2)Installation Complete!$(tput sgr 0)"