Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/perl
- # Author: Michael Stauber <mstauber@solarspeed.net>
- # Copyright 2006, Stauber Multimedia Design. All rights reserved.
- $version = '2.0.0';
- $opt_c = "";
- $opt_h = "";
- use lib "/usr/share/perl5/";
- use Getopt::Std;
- &solbackup_erase_all_sites;
- sub solbackup_erase_all_sites {
- # Delete all sites:
- system("/bin/rm -f /tmp/restore-is-underway");
- system("rm -f /tmp/restore-dumplocation");
- system("touch /tmp/restore-is-underway");
- system("ls -k1 /home/sites/ > /tmp/sitelist.txt");
- $sitelist = "/tmp/sitelist.txt";
- open(SCONFIG, $sitelist);
- @list = <SCONFIG>;
- close (SCONFIG);
- foreach $site (@list) {
- $size = length($site);
- unless ($size < 3) {
- chomp $site;
- print "Deleting site $site:\n";
- system("/usr/sbin/cdelvsite --fqdn $site");
- }
- }
- system("rm -f /tmp/sitelist.txt");
- # If you see this and wonder ... don't. cdelvsite often horribly fails at removing group or user directories ... <sigh>
- system("rm -Rf /home/.sites/[0-9]*");
- system("cp -Rf /home/.users/112/ /tmp/");
- system("rm -Rf /home/.users/");
- system("mkdir /home/.users/");
- system("chmod 755 /home/.users/");
- system("mv /tmp/112 /home/.users/");
- system("chown admin:users -R /home/.users/112/admin/");
- print "All sites have been deleted. \n";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement