#!/bin/sh# Auto Start Server Script by Latheesan (Admin of Nemesis-WarCraft.Com) , AKA Shinigami2007# Your Linux SSH Account Name# Very important !!! This is the username you use to login to your SSH to control your Ascent Emulator# We can use $(whoami) to automatically determine the username, if this isnt working, manually enter itACC=$(whoami)# Ascent Server Binary files pathLogon_Server=ascent-logonserverWorld_Server=ascent-world# Set this to 1 if you want to disable this script aut-restarting your ascent logon/world server during# svn updating for exampleDisabled=0########################### End Of Configuration ############################ Function to check if the server binary files exist, according to the configCheck_Config() { for i in ${Logon_Server} ${World_Server} do if [ ! -f ./$i ]; then echo "Error : Could Not Find $i" exit; fi done}# Function to get the process id of logon server, if it's runningGET_Logon_PID() { logon_pid=$(pgrep -u ${ACC} -f ascent-logonserver) if [ ${logon_pid} ]; then logon_ss=1 else logon_ss=0 fi}# Function to get the pid of map server, if it's runningGET_World_PID() { world_pid=$(pgrep -u ${ACC} -f ascent-world) if [ ${world_pid} ]; then world_ss=1 else world_ss=0 fi}# Run the function to check if the Ascent binary files are thereCheck_Config# Run the function to get the logon and world server's process IDsGET_Logon_PIDGET_World_PID# Check if this script is disabledif [ ${Disabled} -eq 1 ]; then echo "This script is disabled" echo "Edit this file auto_ascent and configure the script like this: Disabled=0" exit;fi# Check if Logon server is down, If it is, then restart itif [ ${logon_ss} -eq 1 ]; then echo "Logon Server Is Running Fine"else echo "Logon Server Is DOWN, Restarting It" echo -e `date '+%D %T'`"\tLogon Server Is DOWN, Restarting It" >> auto_ascent_log.txt exec ./${Logon_Server};fi# Check if World server is down, if it is, then restart itif [ ${world_ss} -eq 1 ]; then echo "World Server Is Running Fine"else echo "World Server Is DOWN, Restarting It" echo -e `date '+%D %T'`"\tWorld Server Is DOWN, Restarting It" >> auto_ascent_log.txt exec ./${World_Server};fi