[freeside-commits]
freeside/FS/bin freeside-delete-addr_blocks, NONE, 1.1
Jeff Finucane,420,,
jeff at wavetail.420.am
Mon Feb 12 16:45:17 PST 2007
Update of /home/cvs/cvsroot/freeside/FS/bin
In directory wavetail:/tmp/cvs-serv4712
Added Files:
freeside-delete-addr_blocks
Log Message:
for dumping addr_blocks
--- NEW FILE: freeside-delete-addr_blocks ---
#!/usr/bin/perl -Tw
use strict;
use vars qw( $user $block @blocks );
use FS::UID qw(adminsuidsetup);
use FS::Record qw(qsearch);
use FS::addr_block;
use FS::svc_broadband;
$user = shift or die &usage;
&adminsuidsetup( $user );
@blocks = qsearch('addr_block', {} );
die "No address blocks" unless (scalar(@blocks) > 0);
foreach $block (@blocks) {
my @devices = qsearch('svc_broadband', { 'blocknum' => $block->blocknum } );
if (@devices) {
print "Skipping block " . $block->ip_gateway . " / " . $block->ip_netmask;
print "\n";
}else{
print "Deleting block " . $block->ip_gateway . " / " . $block->ip_netmask;
print "\n";
$block->delete;
}
}
sub usage {
"Usage:\n freeside-delete-addr_blocks user \n";
}
More information about the freeside-commits
mailing list