Commit a31e0abd authored by Mike Hibler's avatar Mike Hibler
Browse files

Nit: clear out all /var/spool/mail files, not just root's.

parent d58e80e9
#!/usr/bin/perl -w #!/usr/bin/perl -w
# #
# EMULAB-COPYRIGHT # EMULAB-COPYRIGHT
# Copyright (c) 2000-2010 University of Utah and the Flux Group. # Copyright (c) 2000-2012 University of Utah and the Flux Group.
# All rights reserved. # All rights reserved.
# #
use English; use English;
...@@ -22,7 +22,7 @@ my $FSTAB = "/etc/fstab"; ...@@ -22,7 +22,7 @@ my $FSTAB = "/etc/fstab";
my $LOGDIR = "/var/log"; my $LOGDIR = "/var/log";
my $RUNDIR = "/var/run"; my $RUNDIR = "/var/run";
my $HISTORY = ".bash_history"; my $HISTORY = ".bash_history";
my $MAILFILE = "/var/spool/mail/root"; my $MAILDIR = "/var/spool/mail";
my $NTPDRIFT1 = "/etc/ntp/drift"; my $NTPDRIFT1 = "/etc/ntp/drift";
my $NTPDRIFT2 = "/var/lib/ntp/drift"; my $NTPDRIFT2 = "/var/lib/ntp/drift";
my $SFSUSERS = "/etc/sfs/sfs_users"; my $SFSUSERS = "/etc/sfs/sfs_users";
...@@ -233,11 +233,8 @@ if (-f "/root/$HISTORY") { ...@@ -233,11 +233,8 @@ if (-f "/root/$HISTORY") {
die("Could not unlink /root/$HISTORY: $!"); die("Could not unlink /root/$HISTORY: $!");
} }
print "Removing root's mailfile ...\n"; print "Cleaning mail spool files ...\n";
if (-f $MAILFILE) { system("rm -rf $MAILDIR/*");
unlink($MAILFILE) or
die("Could not unlink $MAILFILE: $!");
}
# #
# Remove the iftab file (maps ifaces to mac addrs and renames ifaces according # Remove the iftab file (maps ifaces to mac addrs and renames ifaces according
......
Supports Markdown
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