This version was in use on all servers until this checkin.
It does not log Motds correctly.
This commit is contained in:
parent
033df3cf38
commit
4bfe108380
|
@ -0,0 +1,30 @@
|
||||||
|
#!/usr/bin/perl
|
||||||
|
|
||||||
|
$spooldir = "/usr/adm/motd";
|
||||||
|
$motdfile = "/etc/motd";
|
||||||
|
|
||||||
|
chdir $spooldir || die "cannot chdir to $spooldir";
|
||||||
|
|
||||||
|
# build a list of files in the spool directory
|
||||||
|
opendir DIR, "." || die "cannot open `.'";
|
||||||
|
@files = readdir (DIR);
|
||||||
|
closedir (DIR);
|
||||||
|
|
||||||
|
open MOTD, ">$motdfile" || die "cannot open $motdfile";
|
||||||
|
|
||||||
|
foreach $thisfile (@files) {
|
||||||
|
if (-f $thisfile) {
|
||||||
|
$nonempty=1;
|
||||||
|
print MOTD "\n------------------------------------------------------------\n";
|
||||||
|
open THISFILE, $thisfile || die "cannot open $thisfile";
|
||||||
|
while ($line = <THISFILE>) {
|
||||||
|
print MOTD $line;
|
||||||
|
}
|
||||||
|
close THISFILE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ($nonempty) {
|
||||||
|
print MOTD "\n------------------------------------------------------------\n";
|
||||||
|
}
|
||||||
|
system "/usr/local/bin/ci -l -q $motdfile" || die;
|
||||||
|
exit (0);
|
Loading…
Reference in New Issue