minecraft-forge/entrypoint.sh

26 lines
661 B
Bash
Raw Normal View History

#!/bin/bash
# rmln links dest to target, but removes the target if it already exists.
rmln() {
dest=$1
target=$2
[ -e "$target" ] && rm -rf "$target"
ln -s "$dest" "$target"
}
rmln "$INSTDIR/forge.jar" "$RUNDIR/forge.jar"
rmln "$INSTDIR/libraries" "$RUNDIR/libraries"
2020-08-22 17:30:18 +02:00
rmln "$INSTDIR/minecraft_server.$MINECRAFT.jar" "$RUNDIR/minecraft_server.$MINECRAFT.jar"
rmln "$INSTDIR/eula.txt" "$RUNDIR/eula.txt"
( echo "MINECRAFT=${MINECRAFT}"; echo "FORGE=${FORGE}" ) > $RUNDIR/version.info
chown forge:forge "$RUNDIR"
cd $RUNDIR
2020-08-22 17:00:56 +02:00
exec su forge -c "java -jar $RUNDIR/forge.jar"