#!/usr/bin/perl

BEGIN {
  push @INC,"/etc/openvpn/";
}

use URI::Escape;
use Validate;

$|=1;

while (<>)
{
	($u,$p, $ip) = split;

	my $status = validate(uri_unescape($u), uri_unescape($p), $ip);
	if ($status) {
		print STDOUT "OK\n";
	} else {
		print STDOUT "ERR\n";
	} 
}

