MCServer Autoupdate Script (for Linux)
#23
Finally get the restart on crash script working in linux, with crontab.
PHP Code:
<?php
$url 
'localhost';
$port 25565;
$pauseLength 10;
$fp = @pfsockopen($url$port);
if (!
$fp) {
  echo 
'SERVER DOWN! Rebooting it.',"\r\n";
  `
/usr/bin/pkill MCServer`;
  
sleep($pauseLength);
  `
cd /MCS`;
  `
./MCServer`;
} else {
  echo 
'SERVER UP :)';
}
?>
if you want to use it, remember that it assumes that MCServer executable is in /MCS directory.
Reply
Thanks given by:


Messages In This Thread
RE: MCServer Autoupdate Script (for Linux) - by tonibm19 - 07-18-2013, 05:41 PM



Users browsing this thread: 1 Guest(s)