-
Notifications
You must be signed in to change notification settings - Fork 3
/
etpro-conf-global.sh
executable file
·64 lines (47 loc) · 1.5 KB
/
etpro-conf-global.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
#!/usr/bin/env bash
WET_UID='27960'
WET_GID='27960'
WET_DIR='/srv/wet'
RELATIVE_PATH=$(dirname ${0})
if [[ "${UID}" != '0' ]]; then
echo '> You need to become root to run this script.'
exit 1
fi
if [[ -z "${1}" ]]; then
ETPRO_CONF_ZIP_URL='https://antman.info/wolf/etpro/download.php?serverconfigs/globalconfigsv1_3.zip'
else
ETPRO_CONF_ZIP_URL="${1}"
fi
ETPRO_CONF_ZIP_NAME="$(basename ${ETPRO_CONF_ZIP_URL})"
ETPRO_CONF_ZIP_PATH="/tmp/${ETPRO_CONF_ZIP_NAME}"
if [[ ! -f "${ETPRO_CONF_ZIP_PATH}" ]]; then
wget "${ETPRO_CONF_ZIP_URL}" -O "${ETPRO_CONF_ZIP_PATH}"
fi
TMP_PATH="/tmp/etpro-conf-global-$(date +%s)"
unzip "${ETPRO_CONF_ZIP_PATH}" -d "${TMP_PATH}"
cp -r "${TMP_PATH}/"* "${WET_DIR}/etpro"
# Cleanup.
rm -rf "${TMP_PATH}"
if [[ ! -d "${WET_DIR}/etmain/serverconfigs" ]]; then
mkdir -p "${WET_DIR}/etmain/serverconfigs"
fi
if [[ ! -f "${WET_DIR}/etmain/serverconfigs/etpro.cfg" ]]; then
cp "${RELATIVE_PATH}/../../configs/etpro.cfg" "${WET_DIR}/etmain/serverconfigs/"
fi
cat > "${WET_DIR}/run-etpro.sh" <<EOL
#!/usr/bin/env bash
linux32 ${WET_DIR}/etded.x86 \\
+set dedicated 2 \\
+set net_port 27960 \\
+set fs_game etpro \\
+set fs_homepath servers/27960 \\
+set sv_punkbuster 0 \\
+map te_valhalla \\
+exec serverconfigs/etpro.cfg
EOL
chmod +x "${WET_DIR}/run-etpro.sh"
ln -sf "${WET_DIR}/run-etpro.sh" "${WET_DIR}/run.sh"
# Last correction for ownership and permissions.
chown -R 'wet:wet' "${WET_DIR}"
chmod -R o-rwx "${WET_DIR}"
echo '> Finished.'