#!/usr/bin/perl -w
# clients.migrate - migrate Cistron-style clients file to FreeRADIUS-style clients.conf

sub write_realm {
	my ($realm, $type, $options) = @_;
	print "realm $realm {\n\ttype\t= radius\n\tauthhost\t= $type\n\taccthost\t= $type\n}\n\n"
}

while (<ARGV>) {
	if (/^\s*([\w\.]+)\s+(\w+)\s+(\w+)\s*$/) {
		write_realm($1, $2, $3);
	}
}
