Thread: Auto Reboot?
View Single Post
  #4  
Old 06-05-2014, 07:07 AM
Tabasco's Avatar
Tabasco
Discordant
 
Join Date: Sep 2009
Posts: 269
Default

The technique can vary from setup to setup so I'm not surprised there isn't a one-size-fits-all solution out there.

crontab -e
Code:
00  4     * * *   /usr/bin/php /opt/eqemu/server/doshutdown.php
10  4     * * *   /opt/eqemu/server/stopall && /root/cacheclean.sh && /opt/eqemu/server/startall &
doshutdown.php
Code:
<?php

//Server broadcast
$baseurl = "http://username:password@[localhost|servername|ip]:9080/worldshutdown.html";

$dext = "?time=600&interval=60";

$ch = curl_init();
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_URL, $baseurl.$dext);
curl_exec($ch);
curl_close($ch);
?>
worldshutdown.html - put in the templates folder for the server's http interface
Code:
<?

$stime = $request->get("time", "600");
$sinterval = $request->get("interval", "60");

$EQW->WorldShutDown($stime, $sinterval);

?>
__________________
http://dungeoncrawl.us.to

Last edited by Tabasco; 06-05-2014 at 10:00 AM.. Reason: WorldShutDown is in the latest revision, I just didn't see it first thing in the morning.
Reply With Quote