#!/usr/local/bin/perl
use blib;
use strict;
my ($vos, $server, $part, $volume, $volid);
die "Usage: $0 volume [server partition]\n" if $#ARGV < 0;
$volume = shift;
$server = shift;
$part = shift;
$vos = AFS::VOS->new;
$AFS::CODE and print "AFS::CODE = $AFS::CODE\n";
if ($server) { $volid = $vos->remove($volume, $server, $part); }
else { $volid = $vos->remove($volume); }
if ($AFS::CODE) { print "AFS::CODE = $AFS::CODE\n"; }
else {
if ($server) { printf "Volume %u on partition /vicep%s server %s deleted\n", $volid, $part, $server if $volid; }
else { printf "Volume %u deleted\n", $volid if $volid; }
}