#!/bin/bash
err=1
export CLASSPATH=$CLASSPATH:./lib/commons-logging-1.1.jar
export CLASSPATH=$CLASSPATH:./lib/javolution.jar
export CLASSPATH=$CLASSPATH:./lib/mysql-connector-java-5.1.13-bin.jar
export CLASSPATH=$CLASSPATH:./lib/login.jar
export CLASSPATH=$CLASSPATH:./Config/:.
until [ $err == 0 ]; 
do
 [ -f log/java0.log.0 ] && mv ./log/java0.log.0 "log/`date +%Y-%m-%d_%H-%M-%S`_java.log"
 [ -f log/stdout.log ] && mv ./log/stdout.log "log/`date +%Y-%m-%d_%H-%M-%S`_stdout.log"
 java -Dfile.encoding=UTF8 -Xmx128m -Xloggc:gc.log -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:+CMSIncrementalPacing -XX:MaxPermSize=512m  com.l2jcore.Login.L2LoginServer > ./log/stdout.log 2>&1
 err=$?
 sleep 10;
done
