Here is an example of a primitive TrinityCore restart script for Linux:
Create the first auth.sh file with the contents:
#!/bin/bash
while :; do
/home/trinity/release/bin/authserver -c /home/trinity/release/etc/authserver.conf
sleep 10
done
It will start the authentication server. If it works without errors, then in /etc/rc.local you can specify the path to this file so that it loads at system startup.
Create a second world.sh file with the contents:
#!/bin/sh
logfile='/home/trinity/release/bin/logs/shserver.log'
srvrun='/home/trinity/release/bin/worldserver'
srvname=worldserver
outfile='/home/trinity/release/bin/logs/crash.log'
if [ `ps ax | grep "$srvrun" | grep -v "grep" | wc -l` = 0 ]; then
kill `ps xu | grep "$srvname" | grep "$srvrun" | grep -v "grep" | awk '{print $2}'`
echo "Server CRASHED !!! Start Bugreport System" `date` >> $outfile
echo "Server.log Log FILE Last 30 Lines:" >> $outfile
cat $logfile | tail -n 30 >> $outfile
echo "END bugtracker system." >> $outfile
sleep 20 && $srvrun
fi
exit 0
The game server will be launched on it. You can run through the screen command:
screen -AmdS world /home/trinity/release/bin/world.sh