#! /usr/bin/env perl

$target = "webclient";

while(1) {
	open(PS,"ps x |");
	$found = 0;
	while(<PS>) {
		if(index($_,$target)>0) {
			# found one -- get the process id
			@split = split(/ +/,$_);
			$pid = $split[1];
			# send it a SIGHUP
			print "kill -HUP $pid\n";
			kill SIGHUP, $pid;
			$found++;
		}
	}
	sleep 1;
}
