----- Original Message -----
From: "Jason Humphrey" <jasonh (at mark) businessws.com>
To: <coba-e (at mark) bluequartz.org>
Sent: Tuesday, March 27, 2007 2:59 PM
Subject: [coba-e:09328] Deleting all Vsites
> Anyone know a quick way to remove all users and vsites??
>
> I guess the answer will use cdelvsite.
>
> --
> Kind regards,
>
> Jason Humphrey
>
> E: jasonh (at mark) businessws.com
> M: 07786 393418
> T: 0870 8965598
>
Jason
If you put a list of the sites into a file named: listofsites.txt
ls -1 /home/sites >> listofsites.txt
Then make a file like delistes.pl with the contents below, and run it.
#!/usr/bin/perl
#remove all the sites on list
print "Try to open listofsites.txt\n";
open (FIL,"listofsites.txt") or die "Can't Open\n";
while (<FIL>) {
$thedomain = $_;
chomp $thedomain;
print "delete the site $thedomain\n";
#system("/usr/sbin/cdelvsite -d $thedomain");
system("/usr/sbin/cdelvsite --fqdn $thedomain");
}
close (FIL);
exit;