#!/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" rmln "$INSTDIR/minecraft_server.$MineVers.jar" "$RUNDIR/minecraft_server.$MineVers.jar" rmln "$INSTDIR/eula.txt" "$RUNDIR/eula.txt" ( echo "MINECRAFT=${MINECRAFT}"; echo "FORGE=${FORGE}" ) > $RUNDIR/version.info chown forge:forge "$RUNDIR" cd $RUNDIR exec su forge -c "/usr/bin/java -jar $RUNDIR/forge.jar"