Skip to content

Instantly share code, notes, and snippets.

@jvkumar
Created April 12, 2013 06:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jvkumar/5369788 to your computer and use it in GitHub Desktop.
Save jvkumar/5369788 to your computer and use it in GitHub Desktop.
<?
$restart_output="";
$status_output="";
$handle = @fopen("./{$server}.txt", "r");
if ($handle) {
while (($buffer = fgets($handle, 4096)) !== false) {
$this_server = trim($buffer);
$restart_output .= system("/var/www/cgi-bin/server_services.bash $this_server restart");
echo "$restart_output";
}
if (!feof($handle)) {
echo "Error: unexpected fgets() fail\n";
}
fclose($handle);
}
echo "RESTART = $restart_output <Br>";
=====CHANGE IT TO=========
$restart_output="";
$status_output="";
$handle = fopen("./".$server.".txt", "r");
if ($handle) {
while (($buffer = fgets($handle, 4096)) !== false) {
$this_server = trim($buffer);
$restart_output .= system("/var/www/cgi-bin/server_services.bash ".$this_server." restart");
}
if (!feof($handle)) {
echo "Error: unexpected fgets fail\n";
}
fclose($handle);
}
echo "RESTART = ".$restart_output." <Br>";
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment