GameServer_loop.sh 509 B

1234567891011121314
  1. #!/bin/bash
  2. # exit codes of GameServer:
  3. # 0 normal shutdown
  4. # 2 reboot attempt
  5. while :; do
  6. [ -f log/java0.log.0 ] && mv log/java0.log.0 "log/`date +%Y-%m-%d_%H-%M-%S`_java.log"
  7. [ -f log/stdout.log ] && mv log/stdout.log "log/`date +%Y-%m-%d_%H-%M-%S`_stdout.log"
  8. java -Djava.util.logging.manager=com.l2jserver.util.L2LogManager -Xms1024m -Xmx1024m -cp ./../libs/*:l2jserver.jar com.l2jserver.gameserver.GameServer > log/stdout.log 2>&1
  9. [ $? -ne 2 ] && break
  10. # /etc/init.d/mysql restart
  11. sleep 10
  12. done