View Single Post
dustinandband
Senior Member
Join Date: May 2015
Old 10-14-2018 , 19:28   Re: Shell script to check if server's empty
Reply With Quote #6

@ hustl4
Thanks for the idea. The script appears to be getting hung up. If you do happen to test it out - would you mind uploading it to github so I can include a direct download for the script I'm currently writing? Would be best if there was safeguards against situations where it might get hung up - maybe there could be a timeout feature if the server doesn't respond in x amount of time there's a certain return value. (Since this script is designed to get launched automatically from a cron job task.)

In regards to the auto-updating:
- I can use screen to log output to a file and successfully added update functionality there, but the problem is when you have multiple servers on the same machine and need to make a unique log file name that's the same as the screen session (socket) name.
- Some users say to use tmux instead of screen, so I spent the better part of a day writing out a script to handle auto-launching X amount of servers:
(I still have to make the tmux log.)
Spoiler

- Come to find out after all that work, the latest version of tmux may not be compatible with creating dynamic log names (if i revert to an older version of tmux and ever 'apt-get update', it may break the script):
https://github.com/GameServerManager..._start.sh#L113

Anyway, if that's the case I'll just use something similar to what hustl4 posted. If all game servers are all detected as empty on some night, they'll all get an update then the physical server will do a reboot. The cron job task will relaunch the script ^ and the servers will be back online.

Last edited by dustinandband; 10-16-2018 at 11:41.
dustinandband is offline