#!/bin/bash ########################################################################## # orxonox - the future of 3D-vertical-scrollers # # # # Copyright (C) 2004 orx # # # # This program is free software; you can redistribute it and/or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2, or (at your option) # # any later version. # # # # ### File Specific: # # main-programmer: Christoph Renner # # co-programmer: ... # # # # # # This script starts an orxonox server and restarts it when it crashes.# # it also creates a logfile for each start # # # ########################################################################## PORT="9999" ORXONOXBINARY="./orxonox" LOGDIR="/tmp/orxonox_log" LOGPREFIX="orxonox" SLEEPTIME="5" ORXONOXOPTIONS=" --dedicated-server $PORT" while true; do SD=$(date +'%Y-%m-%d-%H:%M:%S'); CMDLINE="$ORXONOXBINARY $ORXONOXOPTIONS" LOGFILE="$LOGDIR/$LOGPREFIX-$SD.log" echo $CMDLINE; nice $CMDLINE &> "$LOGFILE"; echo "Now is $(date +'%Y-%m-%d-%H:%M:%S')" >> "$LOGFILE"; echo -e "\n\n\nyou have $SLEEPTIME s to kill this script\n\n\n"; sleep $SLEEPTIME done