Piszę mały panel na własne potrzeby,
Mam taki kodzik
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>serwer</title> </head> <body> <?php $start = $_GET['start']; $stop = $_GET['stop']; $restart = $_GET['restart']; for($i=0;$i<count($dir);$i++){ <a href="panel.php?start='.$i.'">Start</a> <a href="panel.php?stop='.$i.'">Stop</a> <a href="panel.php?restart='.$i.'">Restart</a> </form>'; } if($stop!="") { //$out = `ps -aux | grep SCREEN -A -m -d -S hlds*`; class KillAllProcesses { function killallprocesses() { $this->listItems(); } function listItems() { $this->output($output); $this->doKill($array); } function output($output) { } function doKill($array) { } } } new KillAllProcesses(); } ?> </body> </html>
Pokombinowałem trochę i wyszło mi coś takiego ale w tej linii
Kod
$output = shell_exec('ps -x| grep hlds'.$_GET['stop']);
jak dodaję to :
Kod
| grep hlds'.$_GET['stop']
to nie wyświetla mi procesu oprócz
Kod
28245 ? R 0:00 sh -c ps -x| grep hlds1
Może proc_open ? Tylko, że nie wiem jak tego użyć :]
Pozdrawiam