4 use vars qw( $user $block @blocks );
5 use FS::UID qw(adminsuidsetup);
6 use FS::Record qw(qsearch);
10 $user = shift or die &usage;
11 &adminsuidsetup( $user );
13 @blocks = qsearch('addr_block', {} );
14 die "No address blocks" unless (scalar(@blocks) > 0);
16 foreach $block (@blocks) {
17 my @devices = qsearch('svc_broadband', { 'blocknum' => $block->blocknum } );
19 print "Skipping block " . $block->ip_gateway . " / " . $block->ip_netmask;
22 print "Deleting block " . $block->ip_gateway . " / " . $block->ip_netmask;
30 "Usage:\n freeside-delete-addr_blocks user \n";