{
    use esmith::HostsDB;
    my $hostsdb = esmith::HostsDB->open;

    # Handle each defined virtual domain
    foreach my $host ($hostsdb->get_all_by_prop(HostType => "Local"))
    {
	$radiuskey = $host->prop('RadiusKey') || undef;
	next unless defined $radiuskey;

	$hostname = $host->key;
	$hostname =~ s/\..*//;
	$hostip = $host->prop('InternalIP') || '127.0.0.1';
	$nastype = $host->prop('NASType') || 'other';

	$OUT .= <<EOF;
client $hostip \{
	secret = $radiuskey
	shortname = $hostname
	nastype = $nastype
\}
EOF
    }
}
