jrose78 Posted June 21, 2018 Share Posted June 21, 2018 I was looking to setup a cron job to check user count and if 0 then check for update and restart. There is a program called gamedig that I use to get this information from my kf2 server but DST is not supported from what I can tell. Link to comment Share on other sites More sharing options...
Daniel86268 Posted June 22, 2018 Share Posted June 22, 2018 You could go for something like c_listallplayers() from the server console, grep the result and if it's empty/no player listed your software can restart the server. Then you can shut all shards down from the same console you have accessed. c_shutdown() Biggest problem is to get access to the server console here. How are you running your server disconnected from the shell? Screen, docker, nohup or the solution from the quick setup guide? Link to comment Share on other sites More sharing options...
jrose78 Posted June 22, 2018 Author Share Posted June 22, 2018 5 hours ago, Daniel86268 said: Biggest problem is to get access to the server console here. How are you running your server disconnected from the shell? Screen, docker, nohup or the solution from the quick setup guide? I am using tmux Link to comment Share on other sites More sharing options...
Daniel86268 Posted June 22, 2018 Share Posted June 22, 2018 I never used tmux so far, but I guess something like this should work: tmux attach -t <your session name> c_listallplayers() <Some script to check if players are listed. If list is empty run c_shutdown() <startup> > Link to comment Share on other sites More sharing options...
jrose78 Posted June 22, 2018 Author Share Posted June 22, 2018 Thanks, I will start looking in that direction. Link to comment Share on other sites More sharing options...
jrose78 Posted June 30, 2018 Author Share Posted June 30, 2018 I used the commands tmux send-keys -t dstserver 'c_listallplayers()' Enter but that only shows the players on the main server and not the caves server? It also does not return a simple number that I can capture. Does anyone know of any easier way to get a simple player count so I can update the server when the player count = 0 as oppose to a scheduled restart on a certain day and time. Thank You . Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.
Please be aware that the content of this thread may be outdated and no longer applicable.