25 lines
661 B
Bash
Executable file
25 lines
661 B
Bash
Executable file
#!/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.$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
|
|
|
|
exec su forge -c "java -jar $RUNDIR/forge.jar"
|
|
|