Commit 929209f2 authored by David Johnson's avatar David Johnson

Don't worry about updating /etc/dumpdates if /etc/fstab doesn't exist

(i.e., if we're in a straight chroot that has no special files munged into
it).
parent 529edd9e
......@@ -144,28 +144,30 @@ if (-x "/etc/cron.pend/slocate.cron") {
# need entries, and then put in entries for each filesystem using
# the current date.
#
print "Removing old $DUMPDATES file ...\n";
if (-e $DUMPDATES) {
if (-e $FSTAB) {
print "Removing old $DUMPDATES file ...\n";
if (-e $DUMPDATES) {
unlink($DUMPDATES) or
die("Could not unlink $DUMPDATES");
}
}
print "Creating stub /etc/dumpdates file ...\n";
open(TAB, "$FSTAB") or
print "Creating stub /etc/dumpdates file ...\n";
open(TAB, "$FSTAB") or
die("Could not open $FSTAB: $!");
open(DMP, ">$DUMPDATES") or
open(DMP, ">$DUMPDATES") or
die("Could not open $DUMPDATES: $!");
while (<TAB>) {
while (<TAB>) {
if ($_ =~ /^([\w\/]+).*(\d).*\d$/) {
if ($2 != 0) {
my $t = localtime(time);
print DMP "$1 0 $t\n";
}
}
}
close(DMP);
close(TAB);
}
close(DMP);
close(TAB);
print "Cleaning logfiles ...\n";
opendir(LOG,$LOGDIR) or
......
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