Created
January 7, 2012 03:53
-
-
Save Hoikas/1573726 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
define('kPidFile', '/home/dirtsand/server/ds.pid'); | |
function ds_running() | |
{ | |
// No pid file, no shard. | |
if (!file_exists(kPidFile)){ return false; } | |
// Get pid and test to see if that proc is running | |
$pid = file_get_contents(kPidFile); | |
if (file_exists('/proc/'.$pid)) { return true; } | |
else { return false; } | |
} | |
if (ds_running()) { | |
?> | |
Welcome to the Guild of Writers Shard! | |
<?php } else { ?> | |
The Guild of Writers Shard currently down. | |
<?php } ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment