Synched gist at Sat Nov 18 09:01:40 PST 2023

This commit is contained in:
Marco Cawthorne 2023-11-18 09:01:40 -08:00
parent fece84bfde
commit d321a991f7
Signed by: eukara
GPG key ID: CE2032F0A2882A22

View file

@ -9,6 +9,9 @@
# - Deathmatch Classic # - Deathmatch Classic
# - Team Fortress # - Team Fortress
# - Half-Life: Opposing Force # - Half-Life: Opposing Force
# - Gunman Chronicles
# - Scientist Hunt (mod)
# - They Hunger (mod)
# #
# You need to place the three files (unmodified) into # You need to place the three files (unmodified) into
# the same directory as this script: # the same directory as this script:
@ -16,6 +19,9 @@
# hlserver4110.exe # hlserver4110.exe
# csv15full.exe (optional) # csv15full.exe (optional)
# opfor1108.tar.bz2 (optional) # opfor1108.tar.bz2 (optional)
# gunman_server.exe (optional)
# shunt12.exe (optional)
# TheyHunger3.exe (optional)
# #
# Once you've done so, run this script and in the same # Once you've done so, run this script and in the same
# directory the bootstrapping process will begin. # directory the bootstrapping process will begin.
@ -65,6 +71,14 @@ fix_case()
done done
} }
check_pak()
{
if [ -f "$1" ]
then
printf "\t- %s\n" "$2"
fi
}
# dependencies: rewise # dependencies: rewise
if [ ! -f ./rewise ] if [ ! -f ./rewise ]
then then
@ -155,13 +169,37 @@ else
fi fi
# Check if we have Opposing Force's dedicated server files # Check if we have Opposing Force's dedicated server files
if [ -f ./csv15full.exe ] if [ -f ./opfor1108.tar.bz2 ]
then then
FOUND_OPFOR=1 FOUND_OPFOR=1
else else
FOUND_OPFOR=0 FOUND_OPFOR=0
fi fi
# Check if we have Gunman Chronicles's dedicated server files
if [ -f ./gunman_server.exe ]
then
FOUND_GUNMAN=1
else
FOUND_GUNMAN=0
fi
# Check if we have Scientist Hunt's installer files
if [ -f ./shunt12.exe ]
then
FOUND_SCIHUNT=1
else
FOUND_SCIHUNT=0
fi
# Check if we have They Hunger's installer files
if [ -f ./TheyHunger3.exe ]
then
FOUND_HUNGER=1
else
FOUND_HUNGER=0
fi
# extract the installer contents # extract the installer contents
if [ ! -f ./valve/halflife.wad ] if [ ! -f ./valve/halflife.wad ]
then then
@ -193,7 +231,7 @@ then
fi fi
fi fi
# if we have CS its installer detected, extract it # if we have OP4 its installer detected, extract it
if [ "$FOUND_OPFOR" = "1" ] if [ "$FOUND_OPFOR" = "1" ]
then then
# don't bother extracting it, if contents exist # don't bother extracting it, if contents exist
@ -203,6 +241,42 @@ then
fi fi
fi fi
# if we have Gunman's its installer detected, extract it
if [ "$FOUND_GUNMAN" = "1" ]
then
# don't bother extracting it, if contents exist
if [ ! -f ./rewolf/rewolf.wad ]
then
./rewise -x ./ ./gunman_server.exe
cp -a ./MAINDIR/rewolf/. ./rewolf/
rm -rf ./MAINDIR
rm -rf ./TEMP
fix_case -r ./rewolf/
fi
fi
# if we have Scientist Hunt's its installer detected, extract it
if [ "$FOUND_SCIHUNT" = "1" ]
then
# don't bother extracting it, if contents exist
if [ ! -f ./scihunt/hondo3.wad ]
then
unzip ./shunt12.exe -d ./
fix_case -r ./scihunt/
fi
fi
# if we have They Hunger's its installer detected, extract it
if [ "$FOUND_HUNGER" = "1" ]
then
# don't bother extracting it, if contents exist
if [ ! -f ./hunger/pak4.pak ]
then
unzip ./TheyHunger3.exe -d ./
mv ./Hunger ./hunger
fix_case -r ./hunger/
fi
fi
if [ -f ./cstrike/cstrike.wad ] if [ -f ./cstrike/cstrike.wad ]
then then
@ -221,7 +295,7 @@ fi
if [ -f ./gearbox/opfor.wad ] if [ -f ./gearbox/opfor.wad ]
then then
# remove the old FreeCS package # remove the old FreeOP4 package
if [ -f ./gearbox/package_gearbox.pk3 ] if [ -f ./gearbox/package_gearbox.pk3 ]
then then
rm ./gearbox/package_gearbox.pk3 rm ./gearbox/package_gearbox.pk3
@ -233,31 +307,61 @@ then
unzip -p ./gearbox/package_gearbox.pk3 csprogs.dat >gearbox/csprogs.dat unzip -p ./gearbox/package_gearbox.pk3 csprogs.dat >gearbox/csprogs.dat
fi fi
if [ -f ./rewolf/rewolf.wad ]
then
# remove the old FreeGunman package
if [ -f ./rewolf/package_rewolf.pk3 ]
then
rm ./rewolf/package_rewolf.pk3
fi
# get the new FreeGunman package
wget "https://www.frag-net.com/pkgs/package_rewolf.pk3" -P ./rewolf/
unzip -p ./rewolf/package_rewolf.pk3 progs.dat >rewolf/progs.dat
unzip -p ./rewolf/package_rewolf.pk3 csprogs.dat >rewolf/csprogs.dat
fi
if [ -f ./scihunt/hondo3.wad ]
then
# remove the old FreeSciHunt package
if [ -f ./scihunt/package_scihunt.pk3 ]
then
rm ./scihunt/package_scihunt.pk3
fi
# get the new FreeSciHunt package
wget "https://www.frag-net.com/pkgs/package_scihunt.pk3" -P ./scihunt/
unzip -p ./scihunt/package_scihunt.pk3 progs.dat >scihunt/progs.dat
unzip -p ./scihunt/package_scihunt.pk3 csprogs.dat >scihunt/csprogs.dat
fi
if [ -f ./hunger/pak4.pak ]
then
# remove the old StillHungry package
if [ -f ./hunger/package_hunger.pk3 ]
then
rm ./hunger/package_hunger.pk3
fi
# get the new StillHungry package
wget "https://www.frag-net.com/pkgs/package_hunger.pk3" -P ./hunger/
unzip -p ./hunger/package_hunger.pk3 progs.dat >hunger/progs.dat
unzip -p ./hunger/package_hunger.pk3 csprogs.dat >hunger/csprogs.dat
fi
# Final evaluation # Final evaluation
printf "Install/upgrade successful. Detected games that you can host games for:\n" printf "Install/upgrade successful. Detected games that you can host games for:\n"
if [ -f ./valve/package_valve.pk3 ] check_pak ./valve/package_valve.pk3 "Half-Life"
then check_pak ./cstrike/package_cstrike.pk3 "Counter-Strike"
printf "\t- Half-Life\n" check_pak ./tfc/package_tfc.pk3 "Team Fortress Classic"
fi check_pak ./dmc/package_dmc.pk3 "Deathmatch Classic"
if [ -f ./cstrike/package_cstrike.pk3 ] check_pak ./ricochet/package_ricochet.pk3 "Ricochet"
then check_pak ./gearbox/package_gearbox.pk3 "Half-Life: Opposing Force"
printf "\t- Counter-Strike\n" check_pak ./rewolf/package_rewolf.pk3 "Gunman Chronicles"
fi check_pak ./scihunt/package_scihunt.pk3 "Scientist Hunt"
if [ -f ./tfc/package_tfc.pk3 ] check_pak ./hunger/package_hunger.pk3 "They Hunger"
then
printf "\t- Team Fortress Classic\n"
fi
if [ -f ./dmc/package_dmc.pk3 ]
then
printf "\t- Deathmatch Classic\n"
fi
if [ -f ./ricochet/package_ricochet.pk3 ]
then
printf "\t- Ricochet\n"
fi
if [ -f ./gearbox/package_gearbox.pk3 ]
then
printf "\t- Half-Life: Opposing Force\n"
fi