From 4bfe108380750058ac736d9020ca2f446f17e271 Mon Sep 17 00:00:00 2001 From: hjp Date: Tue, 25 Jul 1995 10:23:28 +0000 Subject: [PATCH] This version was in use on all servers until this checkin. It does not log Motds correctly. --- mkmotd/mkmotd | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100755 mkmotd/mkmotd diff --git a/mkmotd/mkmotd b/mkmotd/mkmotd new file mode 100755 index 0000000..a36c2d9 --- /dev/null +++ b/mkmotd/mkmotd @@ -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 = ) { + print MOTD $line; + } + close THISFILE; + } +} +if ($nonempty) { + print MOTD "\n------------------------------------------------------------\n"; +} +system "/usr/local/bin/ci -l -q $motdfile" || die; +exit (0);