[Linux] Server Management Script

I have written a bash script for TrinityCore for any who are interested. It allows you to start, stop, force-stop (kill -9), restart, and verify status of both authserver and worldserver simultaneously or individually. Output messages provide variables to customize how they look to better fit your logs or other needs; or even to more easily re-write in your native tongue if it is not English.

The script is designed for an install situated as “/some/path/bin/” and “/some/path/pid/” by default. If your setup matches this, then you only have to change one variable, “SRVROOT”, at the top of the script and nothing else. Even if your setup is slightly different there are only 4 variables to truly configure, so even the most novice user should be able to figure it out /emoticons/default_smile.png

Multiple worldservers are easily supported, too, if you have different binary names for them such as /some/path/bin/worldserver1 and /some/path/bin/worldserver2. This can be easily setup by yourself with symlinks; the script just needs to know a unique name for each.

Enjoy!

https://github.com/Kline-/TrinityCore-Patches/tree/master/run_script

you do know that one binary can be used to run several servers, as long as you have copies of the worldserver.conf (worldserver1.conf, etc.) and add -c worldserver1.conf, etc. to the commandline, right?

each conf file has to have a separate realmid set in it.

Yes. My script recognizes things by binary name which is why I just suggested symlinking a single binary to multiple names for the purpose of differentiating which one you are calling via the script.

sometimes, I wonder why I bother reading this forum when I’m tired, somehow I missed the symlink part, lol.

Nice,

thank you for this great script, but somehow i cant get it to work, the problem is that i am only running one core instance and the homepath to the worldserver and authserver is /home/trinity/bin/.

I have tried to comment out “$2” but i only get an error telling me that permission or path are not correct, permissions are 100% correct since i can manually start the server with user “trinity”.

I would be very thankful for any hints and help,

Greetings,

snitride

**Update just was reading through the above posts and released that i just could symlink the binaries to a server subfolder.

Question, does anyone know a really simple bashscript for starting and stopping the worldserver and authserver maybe in combination with screen or tmux, i need it for a cronjob

.