Skip to content

Instantly share code, notes, and snippets.

@jvkumar

jvkumar/ben.php

Created Apr 12, 2013
Embed
What would you like to do?
<?
$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