#!/usr/local/bin/perl

use v5.10.0;
use blib;
use strict;
use warnings;

use AFS::BOS;

my (@hosts, $host, $server, $cellname, $bos);

die "Usage: $0 host server [cell]\n" if $#ARGV < 1;

$host     = shift;
$server   = shift;
$cellname = shift // '';

if ($cellname) { $bos = AFS::BOS->new($server, 0, 0, $cellname); }
else           { $bos = AFS::BOS->new($server); }
$AFS::CODE and print "AFS::CODE = $AFS::CODE\n" and die;

@hosts = split (/ /, $host);
my $ok = $bos->removehost(\@hosts);
print "Error Code: $AFS::CODE\n" if ($AFS::CODE);

$bos->DESTROY;
