Skip to content

Commit 14f42b2

Browse files
authored
Merge pull request #54 from sparkedhost/fix_dayz_cfg
2 parents 504a34c + 4f7493d commit 14f42b2

1 file changed

Lines changed: 21 additions & 2 deletions

File tree

games/dayz/entrypoint.sh

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,25 @@ source /spark_utils.sh
88

99
sleep 1
1010

11+
unzip_game_files() {
12+
if [[ "${SRCDS_APPID}" == "223350" ]]; then
13+
local unzip_excludes=()
14+
15+
[[ -f "dayzsetting.xml" ]] && unzip_excludes+=("dayzsetting.xml")
16+
[[ -f "serverDZ.cfg" ]] && unzip_excludes+=("serverDZ.cfg")
17+
[[ -f "ban.txt" ]] && unzip_excludes+=("ban.txt")
18+
[[ -f "whitelist.txt" ]] && unzip_excludes+=("whitelist.txt")
19+
20+
if [[ ${#unzip_excludes[@]} -gt 0 ]]; then
21+
unzip -o "${ZIP_FILE}" -x "${unzip_excludes[@]}"
22+
return
23+
fi
24+
fi
25+
26+
unzip -o "${ZIP_FILE}"
27+
}
28+
29+
1130
[[ ! -d $SERVER_HOME/steamcmd ]] && install_steamcmd
1231
cd /home/container
1332

@@ -27,15 +46,15 @@ if [ "${AUTO_UPDATE}" == "1" ]; then
2746
rm -f "${ZIP_FILE}"
2847
exit 1
2948
fi
30-
unzip -o "${ZIP_FILE}"
49+
unzip_game_files
3150
fi
3251
else
3352
wget -q -O "${ZIP_FILE}" "${REMOTE_URL}"
3453
if ! unzip -t "${ZIP_FILE}" > /dev/null; then
3554
rm -f "${ZIP_FILE}"
3655
exit 1
3756
fi
38-
unzip -o "${ZIP_FILE}"
57+
unzip_game_files
3958
fi
4059
else
4160
echo -e "Not updating game server as auto update is off. Starting Server"

0 commit comments

Comments
 (0)