-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2d88b7e
commit 4cc0afa
Showing
5 changed files
with
32 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,21 @@ | ||
FROM ubuntu:14.04 | ||
FROM ubuntu:focal | ||
|
||
MAINTAINER Chris Grimmett <[email protected]> | ||
|
||
# add server assets to container | ||
ADD ./assets /srv/assets | ||
|
||
# satisfy setup script and bf1942 dependencies | ||
RUN apt-get update && \ | ||
apt-get -y install wget expect libc6-i386 lib32ncurses5 libc6-dev-i386 | ||
RUN \ | ||
dpkg --add-architecture i386 && \ | ||
apt-get -y update && \ | ||
apt-get -y install expect wget libc6-i386 libc6-dev-i386 libncurses5:i386 | ||
|
||
# setup battlefield server package | ||
# * downloads needed bf server files | ||
# * extracts 1.6 files | ||
# * patches to 1.61 | ||
RUN bash -x /srv/assets/setup.sh | ||
|
||
|
||
# set default command for running this container (run bf server) | ||
CMD /srv/start.sh | ||
EXPOSE 14567/udp 22000/udp 23000/udp | ||
|
||
# set default command for running this container (run bf server) | ||
CMD /srv/assets/start.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
af60e2a2abd3a142da248276d558d43a *bf1942_lnxded-1.6-rc2.run | ||
7534f940c5e0db0bc0653a2b37076622 *bf1942-update-1.61.tar.gz | ||
ea9124fa53c8d6d2fc4fd4c17360f660 bf1942_lnxded-1.612-patched.tar.gz | ||
af60e2a2abd3a142da248276d558d43a bf1942_lnxded-1.6-rc2.run |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,52 @@ | ||
#!/bin/bash | ||
|
||
serverFile='/tmp/bf1942_lnxded-1.6-rc2.run' | ||
patchFile='/tmp/bf1942-update-1.61.tar.gz' | ||
serverPatchFile='/tmp/bf1942_lnxded-1.612-patched.tar.gz' | ||
|
||
|
||
# verify needed files are downloaded | ||
# download the server if it's not already downloaded | ||
# download the server | ||
if [[ ! -e $serverFile ]]; then | ||
echo 'downloading 1.6 server' | ||
wget 'https://dweb.link/ipfs/bafybeibdg5vpsldsfuvemdk4wfi6es46noxnbg6pjxjsmb27tr6g74wmfq?filename=bf1942_lnxded-1.6-rc2.run' -O $serverFile | ||
echo 'Downloading BF1942 server' | ||
wget -q 'https://dweb.link/ipfs/bafybeibdg5vpsldsfuvemdk4wfi6es46noxnbg6pjxjsmb27tr6g74wmfq?filename=bf1942_lnxded-1.6-rc2.run' -O $serverFile | ||
fi | ||
|
||
# download patch if not already downloaded | ||
if [[ ! -e $patchFile ]]; then | ||
echo 'downloading 1.61b patch' | ||
wget 'https://dweb.link/ipfs/bafybeie7463ofgnn2dhcxwqd7zvkyrv24mn4suose55aahlm74oq7z3nw4?filename=bf1942-update-1.61.tar.gz' -O $patchFile | ||
# download 1.612 patch | ||
if [[ ! -e $serverPatchFile ]]; then | ||
echo 'Downloading Team SIMPLE BF1942 Server 1.612 patched' | ||
wget -q 'https://dweb.link/ipfs/bafybeif2gncdf2ewmqahd6jhn5hld2v65ck3pyzff4yqfzdtom4vjay4tu?filename=bf1942_lnxded-1.612-patched.tar.gz' -O $serverPatchFile | ||
fi | ||
|
||
# copy downloaded files in tmp dir to current dir | ||
cp $serverFile /srv/assets | ||
cp $patchFile /srv/assets | ||
cp $serverFile /tmp/ | ||
cp $serverPatchFile /tmp/ | ||
|
||
# verify downloaded files are valid | ||
cd /srv/assets | ||
cd /tmp | ||
cp /srv/assets/MD5SUMS . | ||
md5sum -c MD5SUMS | ||
|
||
if [[ $? -ne 0 ]]; then | ||
echo 'downloaded file integrity check failed' | ||
echo 'file integrity check failed' | ||
exit 1 | ||
else | ||
echo 'downloaded files are full of integrity' | ||
echo 'files are full of integrity' | ||
fi | ||
|
||
# extract 1.6 files | ||
chmod +x /srv/assets/bf1942_lnxded-1.6-rc2.run | ||
# extract server files | ||
cp /srv/assets/extract | ||
./extract | ||
|
||
|
||
# verify files extracted as they should | ||
if [[ $? -ne 0 ]] || [[ ! -e /srv/bf1942 ]]; then | ||
echo '1.6 server files did not extract correctly' | ||
exit 1 | ||
fi | ||
|
||
# patch to 1.61 | ||
tar -xvf ./bf1942-update-1.61.tar.gz -C /srv | ||
# extract patch files | ||
tar -xvzf bf1942_lnxded-1.612-patched.tar.gz -C /srv | ||
|
||
# create a link to the start script | ||
cp /srv/assets/start.sh /srv/start.sh | ||
|
||
# link | ||
ln -s /srv/bf1942/bf1942_lnxded.static /srv/bf1942/bf1942_lnxded | ||
|
||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,6 @@ | ||
#!/bin/bash | ||
|
||
# send heartbeat to the new master server (workaround for gamespy shutdown) | ||
echo 'starting battlefield 1942 server' | ||
echo '109.71.69.254 master.gamespy.com' >> /etc/hosts | ||
cat /etc/hosts | ||
|
||
# start the server | ||
cd /srv/bf1942 | ||
/srv/bf1942/start.sh | ||
./bf1942_lnxded.static |