#!/usr/bin/perl -w

use strict;
use POSIX ":sys_wait_h";

print "content-type: text/plain\n";
print "content-length: 4\n\n";
my $buffer;

if ($ENV{REQUEST_METHOD} eq 'POST') {
    read(STDIN, $buffer, $ENV{CONTENT_LENGTH});

    my $param;
    my $value;
    ($param,$value)=split(/=/,$buffer);
    
    if ($value eq "hello") {
		print "[OK]\n";
		system("nohup /usr/local/controller/scripts/req.pl &");
	}
}
