More Linux SH Programming

Hey Everyone!

Since you did an awesome job of helping me last time I am back again. Now I just need to figure out how to do two things.

First: is to create a cron job that will run a file lets say named monitor in /usr/local/games/
But I also need to know what command to user in monitor. I want to be able to monitor that my game servers are up and if not reboot them. I already know the command to reboot I just can't figure out how to check and see if they are online. Maybe somehow check to see if the port is running or something. An ip would be like 209.67.221.234:27015. These are HLDS and HL2DS game servers.

Second: how to create a file from sh programming in the background that has info such as like
ip=thisip
port=thisport
slots=thismany
myname=chris
username=userhere
password=passhere

and then I can access the file again somehow in the sh file if I need to and take a variable out of it so if I somehow get the info from the file and then run like echo $ip and it would show "thisip"

Please help!

Thanks!

 

 

 

 

Top