Commit 903b890d authored by Mike Hibler's avatar Mike Hibler

Clean out some more files

parent f40959c0
#!/usr/bin/perl -w
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2004 University of Utah and the Flux Group.
# Copyright (c) 2000-2005 University of Utah and the Flux Group.
# All rights reserved.
#
use English;
......@@ -13,11 +13,12 @@ require 'ctime.pl';
#
my $DUMPDATES = "/etc/dumpdates";
my @DBFILES = ();
my @VARDIRS = ("logs", "db", "jails", "boot", "lock", "lib/dhcp");
my @SYSVARDIRS = ("lib/dhcp", "spool/clientmqueue");
my @VARDIRS = ("logs", "db", "jails", "boot", "lock");
my $FSTAB = "/etc/fstab";
my $LOGDIR = "/var/log";
my $RUNDIR = "/var/run";
my $HISTORY = "/.bash_history";
my $HISTORY = ".bash_history";
my $MAILFILE = "/var/spool/mail/root";
my $NTPDRIFT = "/etc/ntp/drift";
my $SFSUSERS = "/etc/sfs/sfs_users";
......@@ -151,9 +152,13 @@ if (-d $VARACCTDIR) {
}
print "Removing root's history ...\n";
if (-f $HISTORY) {
unlink($HISTORY) or
die("Could not unlink $HISTORY: $!");
if (-f "/$HISTORY") {
unlink("/$HISTORY") or
die("Could not unlink /$HISTORY: $!");
}
if (-f "/root/$HISTORY") {
unlink("/root/$HISTORY") or
die("Could not unlink /root/$HISTORY: $!");
}
print "Removing root's mailfile ...\n";
......@@ -190,6 +195,13 @@ if (-f $SFSHOSTKEY) {
system("rm -f $SFSHOSTKEY");
}
print "Clearing out directories in /var ...\n";
foreach my $dir (@SYSVARDIRS) {
if (-d "/var/$dir") {
system("rm -rf /var/$dir/*");
}
}
print "Clearing out directories in $VARDIR ...\n";
foreach my $dir (@VARDIRS) {
if (-d "$VARDIR/$dir") {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment