#!/usr/bin/perl
$sqlrelay = '/usr/bin/query';
$host=shift;
$port=shift;
$socket=shift;
$user=shift;
$passwd=shift;
while(<>){
	chomp;
	`$sqlrelay '$host' '$port' '$socket' '$user' '$passwd' '$_'`;
	$exit = $? >> 8;
	if ($exit != 0){
		exit $exit;
	}
}
