Skip to content

Instantly share code, notes, and snippets.

@adkinss
Last active May 16, 2021 22:31
Show Gist options
  • Save adkinss/a4115b857acef641c26b0d716d849fcb to your computer and use it in GitHub Desktop.
Save adkinss/a4115b857acef641c26b0d716d849fcb to your computer and use it in GitHub Desktop.
Valhelsia 3 Server Upgrade Script
#!/bin/bash
ZIP=~/Downloads/Valhelsia+3-3.3.2-SERVER.zip
OLD=Valhelsia-3.3.1
NEW=Valhelsia-3.3.2
if [[ ! -e $ZIP ]]; then
echo "$ZIP does not exist. Specify the correct zip file to use."
exit 0
fi
if [[ ! -d $OLD ]]; then
echo "$OLD does not exist. Verify configuration is correct."
exit 0
fi
if [[ -d $NEW ]]; then
echo "$NEW already exists, please delete."
exit 0
fi
# Copy the old version to the new directory
rsync -av $OLD/ $NEW/ --exclude-from=- <<EOF
backups
logs
config
crash-reports
defaultconfigs
libraries
openloader
kubejs
mods
mods-disabled
paintings
forge*jar
README.txt
ServerStart.*
server-icon.png
server.properties
EOF
(
cd $NEW
unzip $ZIP
)
# Replace Xaeros with Journeymap, downgrade Light-Overlay, and install a couple other mods
mkdir -p $NEW/mods-disabled
mv -f $NEW/mods/Xaeros* $NEW/mods-disabled/
cp -p $OLD/mods/journeymap-*.jar $NEW/mods/
mv -f $NEW/mods/light-overlay-5.8.1.jar $NEW/mods-disabled/
cp -p $OLD/mods/light-overlay*.jar $NEW/mods/
cp -p $OLD/mods/rad-1.16*.jar $NEW/mods/
cp -p $OLD/mods/chunkloaders-*.jar $NEW/mods/
cp -p $OLD/mods/supermartijn642configlib-*.jar $NEW/mods/
# Copy over configs from old version
cp -p $OLD/config/waila/waila_plugins.json $NEW/config/waila/
cp -p $OLD/config/lightoverlay.properties $NEW/config/
cp -p $OLD/config/ftbbackups-common.toml $NEW/config/
# Make sure the startup script is executable
chmod 755 $NEW/ServerStart.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment