PDA

View Full Version : /etc/motd


xchanyazy
02-08-2002, 05:32 PM
Is there a way to have this automatically change everyday, as in if I have a bunch of text files in a directory, is there some way I could get them to rotate in and out of being the motd?

stetner
02-08-2002, 07:04 PM
In /private/etc/daily there is this section:


if [ -f /etc/daily.local ]; then
echo ""
echo "Running daily.local:"
sh /etc/daily.local
fi


So I would write up a script like:

#! /bin/sh

mv /etc/motd.`date '+%a'` /etc/motd


And call it /etc/daily.local chown/chgrep/chmod it to root/wheel/750 and then create your 7 files:

/etc/motd.Sat
/etc/motd.Sun
....

With your messages. Note that you could choose to create motd files on the fly etc. for example with the output of fortune or some such stuff.

Doug

xchanyazy
02-09-2002, 02:50 AM
Excellent, thanks.

sao
02-13-2002, 04:21 AM
If you use fink you can install:

fortune-mod 9708-2 Database of witticisms

Then just write:

fortune

in your ~/.cshrc file.

Cheers...

stetner
02-13-2002, 07:12 AM
Yes, fortune is good!

I never thought to mention that, I thought he might have wanted something specific for each day of the week like:

Monday - Post sales to ledger
Tuesday - Change left sock
Wednesday - water the cat
Thursday - Soup day!
...
8-)

xchanyazy
02-13-2002, 10:33 AM
I was thinking more along the lines of what stetner originally posted, but fortune is really neat too.

Also, if I wanted to have it random instead of every day, I could just edit the fortune databases... The man pages for it are interesting. Try the -o flag.

sao
02-13-2002, 11:55 PM
-o

.....
.....
philosphy of The Brotherhood, as handsomely summarized
in these words: we believe in healthy, hearty
laughter -- at the expense of the whole human race,
if needs be.


Needs be.



Cheers...