Screen ist Pflicht, sonst gehts nicht.
Gleichzeitig 2 Fliegen, eine Klappe, den GC jagt die ini´s in einen "Portname"-Ordner.
Code:
# Settings
SERVICE='craftbukkit-1.1.jar'
OPTIONS='nogui'
XMS=$1
XMX=$2
IP=$3
PORT=$4
PIDFILE=port"$4".pid
# Serverstartline
INVOCATION="java $XMS $XMX -jar $SERVICE $OPTIONS $IP $PORT"
# PID from GC-Screen to pidfile
ps -ef | grep SCREEN | grep $IP | grep $PORT | grep -v grep | awk ' { print $2 }' > $PIDFILE
# copy mc-server to port-destination-folder
cp -f $SERVICE port$PORT/
# change director to port-destination-folder
cd port$PORT/
# Start mc-Server with all settings
$INVOCATION