All pastes #395884 Raw Edit

udlas

public text v1 · immutable
·published 2007-03-15 10:56 UTC
rendered paste body
$script_name = "distribution.php";
$my_pid=shell_exec("pgrep -f $script_name");
$my_pid=trim($my_pid);
$ps = shell_exec("pgrep -f -l $script_name |grep -v $my_pid | grep -v grep");

if($ps)
 {
	exit();
 }

Works, with output : sh: line 2: 25571: command not found