-   Linux - General (
-   -   Message of the day (

AliDigitaly 02-17-2004 07:27 AM

Message of the day
Hi all, as I am new to this forum I'll start with a simple question.

How can I make "message of the day" rotate every day, and how could i add variables to it.

i.e.: When i log into my linux box with ssh/telnet, i get this message:

*Welcome to HAL9000, where everything is running extremely well.

Now i want to add some variables to it:

*Today is $$/$$/$$$$, and the time is $$:$$

*Todays wisdom is: $ (example: Grass can be smoked as well.)

Can that be done?

frieza 02-17-2004 06:22 PM

hmm, perhaps you could set up a cron job to pull a random line from say /usr/games/fortune (MESSAGEOFDAYVARIABLE=`/usr/games/fortune`, or a file of yours every day at midnight, or something like that

AliDigitaly 02-17-2004 07:55 PM

Thanks :)

I will have skip the time part then ...but no problem.
Got enough clocks anyway.

AliDigitaly 02-18-2004 07:59 AM


Originally posted by AliDigitaly
...but no problem.
I was to positive..

Found out 'fortune' is encoded.

frieza 02-18-2004 09:37 AM

try this:
/usr/games/fortune > /etc/motd
as your cron job, that should work

AliDigitaly 02-18-2004 10:11 AM

ahhaaa /etc/motd is message of the day :)
Finaly found it.

Hey but what does fortune do then...and why should I use that in this case?

frieza 02-18-2004 10:49 AM

fortune is nothing more than an electronic 'fortune cookie', i was simply using it as an example of what you can do...

AliDigitaly 02-18-2004 10:54 AM

OK, thanks again.

I will use php to do the job, since i have more experience in that.

frieza 02-18-2004 03:38 PM

yeah, right, glad to be of service :D

AliDigitaly 02-18-2004 05:15 PM

...really ;)

All times are GMT -5. The time now is 01:51 PM.