LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 11-24-2001, 10:13 AM   #1
zhenwu
Member
 
Registered: Jul 2001
Location: Taiwan (ex-Victoria BC)
Distribution: RH 9.0
Posts: 126

Rep: Reputation: 15
MOTD fun


Hey all,

Is there a way to have a 'random' MOTD come up upon login? I know that MOTD is in the /etc dir, but I was wondering if there is some way to put in a whole list of messages and have the system pick one each time I login.

Thanks,
 
Old 11-24-2001, 10:39 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981
you want to look at 'fortune'

when i log into my server i get a very occasionally amusing quote from the standard fortune library, by adding:

echo - > /etc/motd
/usr/games/fortune >> /etc/motd
echo - >> /etc/motd

so i get....

-
dull quote
-
[user@host dir]#

you can make your own fortune files easily enough... read up a bit
 
Old 11-24-2001, 05:13 PM   #3
sdkramer
LQ Newbie
 
Registered: Sep 2001
Posts: 5

Rep: Reputation: 0
and if you really want to make it a motd set that up as a shell script to run everyday at 12:00 in crontab
 
Old 01-30-2003, 05:42 PM   #4
kenshorin
LQ Newbie
 
Registered: Jan 2003
Posts: 1

Rep: Reputation: 0
A related question... is there a way I can set up the MOTD to say different things to different users? For instance, I want to set up a guest account, and I want the MOTD to say something other than what it will be saying to me on my account. What kind of script can I write to do this?
 
Old 01-30-2003, 06:36 PM   #5
bulliver
Senior Member
 
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86_64; Gentoo PPC; FreeBSD; OS X 10.9.4
Posts: 3,760
Blog Entries: 4

Rep: Reputation: 78
You would need the script to test for the UID, so if this guest account's UID is 1005..

psuedocode:
Code:
if [ UID = 1005 ] ; then 
   motd a
else
   motd b
fi

Last edited by bulliver; 01-30-2003 at 06:38 PM.
 
Old 03-14-2003, 03:13 PM   #6
Jonbond
LQ Newbie
 
Registered: Mar 2003
Location: Manassas va
Distribution: Gentoo 1.4
Posts: 2

Rep: Reputation: 0
was wondering is there away to setup so that ur motd will tell u the time and what day it is?
i was thinking it would be similar too %h %m but dont know the appropriate linux command/code

thx a bunch
 
Old 03-14-2003, 04:29 PM   #7
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981
that wouldn't relate to motd, you'd simply add the relevant commands to your personal or global bashrc / profile file
 
Old 03-14-2003, 05:22 PM   #8
tcaptain
LQ Addict
 
Registered: Jul 2002
Location: Montreal
Distribution: Gentoo 2004 from stage 1 baby!
Posts: 1,403

Rep: Reputation: 45
What about users logging in graphically (ie: GDM and such)

How do you get MOTD to display for them? Any suggestions?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
/etc/motd skate Linux - Software 5 05-03-2006 08:44 AM
motd toothe Linux - Newbie 2 11-08-2005 04:02 PM
Motd wizex Slackware 6 09-05-2005 08:27 AM
motd iomari Linux - Software 5 04-03-2005 04:43 AM
Is there any MOTD software available besides /etc/motd? csif Linux - Software 1 04-24-2004 06:36 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 07:49 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration