2 startserver_loop.sh
Christian Voigt edited this page 6 months ago
#!/bin/bash  
title=${1:-"pve_exp"}  
suffix=${2:-"20200805"}  
  
gamedir="7dtd_a19"  
homedir="/opt/${title}"  
  
date=`date +%Y-%m-%d_%H-%M-%S`  
  
full_configfile="${title}_${suffix}.xml"  
  
export LD_LIBRARY_PATH=${homedir}/${gamedir}  
  
count="1"  
logfile="${homedir}/${gamedir}_Logs/${title}_${suffix}_${date}.txt"  
configfile="${homedir}/${gamedir}_SaveGames/${title}_${suffix}.xml"  
parameters="-quit -batchmode -nographics -dedicated"  
  
cd ${gamedir}  
printf "%s\n\n" "starting infinite serverloop for" "${title}" "with" "${full_configfile}" "on" "${date}"  
  
while true  
do  
        printf "%s\n\n" "current-loop=${count}"  
        ./7DaysToDieServer.x86_64 -logfile ${logfile} -configfile=${configfile} ${parameters}  
        printf "%s\n\n" "waiting for server to settle down"  
        sleep 10  
        count=$((count + 1))  
done  
  
cd ..