#!/usr/bin/perl

use File::Basename;
use lib dirname (__FILE__);

use URI::Escape;
use NVPNApi;

$|=1;

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

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

