Skip to content

Commit

Permalink
Merge pull request #134 from doudalidou/master
Browse files Browse the repository at this point in the history
alloc_fixes.sh with full alpha20 support + undeadlegacy with stable2 mirror support
  • Loading branch information
vinanrra authored Sep 6, 2022
2 parents ab25f9e + ba8180f commit f01587c
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 5 deletions.
4 changes: 3 additions & 1 deletion scripts/Mods/alloc_fixes.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
#!/bin/bash

MODS_FOLDER=/home/sdtdserver/serverfiles/Mods
VERSION=${VERSION,,}


# Change DL_LINK depending on 7 days to die branch version
if [ "${VERSION,,}" == 'stable' ] || [ "${VERSION,,}" == 'public' ]; then
DL_LINK="http://illy.bz/fi/7dtd/server_fixes.tar.gz"
elif [ "${VERSION,,}" == 'alpha20' ]; then
elif [ "${VERSION::7}" == 'alpha20' ]; then
DL_LINK="http://illy.bz/fi/7dtd/server_fixes.tar.gz"
elif [ "${VERSION,,}" == 'alpha19.6' ] || [ "${VERSION,,}" == 'alpha19.5' ]; then
DL_LINK="http://illy.bz/fi/7dtd/server_fixes_v21_23_38.tar.gz"
Expand Down
23 changes: 19 additions & 4 deletions scripts/Mods/undead_legacy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,27 @@ SERVER_CONFIG=${SERVERFILES_FOLDER}/sdtdserver.xml

if [ "${UNDEAD_LEGACY_VERSION,,}" == 'exp' ]; then
echo "[Undead Legacy] Starting install of Undead Legacy ${UNDEAD_LEGACY_VERSION,,} version"
elif [ "${UNDEAD_LEGACY_VERSION,,}" == 'stable' ]; then
MIRROR_EXT=zip

elif [ "${UNDEAD_LEGACY_VERSION,,}" == 'stable' ]; then
echo "[Undead Legacy] Starting install of Undead Legacy ${UNDEAD_LEGACY_VERSION,,} version"
MIRROR_EXT=zip

elif [ "${UNDEAD_LEGACY_VERSION,,}" == 'stable2' ]; then
echo "[Undead Legacy] Starting install of Undead Legacy ${UNDEAD_LEGACY_VERSION,,} version from mirror"
MIRROR_EXT=tar

else
echo "[Undead Legacy] Error wrong version selected -> ${UNDEAD_LEGACY_VERSION,,}, select exp or stable"
echo "[Undead Legacy] Skipping installation"
exit
fi

MIRROR_FILE=undeadlegacy.${MIRROR_EXT}
DL_LINK="https://ul.subquake.com/dl?v=${UNDEAD_LEGACY_VERSION,,}"

downloadRelease() {
curl "$DL_LINK" -SsL -o undeadlegacy.zip
curl "$DL_LINK" -SsL -o ${MIRROR_FILE}
}

echo "[Undead Legacy] Downloading release from $DL_LINK"
Expand All @@ -32,7 +40,12 @@ downloadRelease
echo "[Undead Legacy] Extracting files"

mkdir -p undeadlegacy-temp
unzip -q undeadlegacy.zip -d undeadlegacy-temp

if [ "${MIRROR_EXT}" == 'tar' ]; then
tar -xf ${MIRROR_FILE} -C undeadlegacy-temp
else
unzip -q ${MIRROR_FILE} -d undeadlegacy-temp
fi

if [ -d "$SERVERFILES_FOLDER/BepInEx" ]
then
Expand All @@ -47,6 +60,8 @@ if [ "${UNDEAD_LEGACY_VERSION,,}" == 'exp' ]; then
cp -a undeadlegacy-temp/UndeadLegacyExperimental-main/. $SERVERFILES_FOLDER
elif [ "${UNDEAD_LEGACY_VERSION,,}" == 'stable' ]; then
cp -a undeadlegacy-temp/UndeadLegacyStable-main/. $SERVERFILES_FOLDER
elif [ "${UNDEAD_LEGACY_VERSION,,}" == 'stable2' ]; then
cp -a undeadlegacy-temp/UndeadLegacyStable-main/. $SERVERFILES_FOLDER
else
echo "[Undead Legacy] Error wrong version selected -> ${UNDEAD_LEGACY_VERSION,,}, select exp or stable"
echo "[Undead Legacy] Skipping installation"
Expand All @@ -55,7 +70,7 @@ fi

echo "[Undead Legacy] Cleanup"

rm undeadlegacy.zip
rm ${MIRROR_FILE}
rm -rf undeadlegacy-temp

echo "[Undead Legacy] Adding Undead Legacy default options to server configuration"
Expand Down

0 comments on commit f01587c

Please sign in to comment.