Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

How would you include the list and / or count of pending updates in the welcome banner?

Eg.

username: User
password: *****

Hi 'User', welcome on 'localhost'
There are 8 pending updates, you need to execute "sudo apt-get upgrade"

User@localhost:~$

Bonus question : How to display this "extra message" only for users belonging to the "sudo" group ?

share|improve this question
2  
Put code to do that in /etc/profile, and have that code check for group membership. –  Jenny D May 21 '13 at 12:52
1  
Recent versions of Ubuntu already do this, have a look at /etc/update-motd.d/90-updates-available. –  mgorven May 21 '13 at 17:12
1  
@mgorven Confirmed. /etc/update-motd.d/90-updates-available does it via /usr/lib/update-notifier/update-motd-updates-available on my Ubuntu 11.04 box. –  Joseph R. May 21 '13 at 23:28
    
Just to keep everybody posted, I'm not droping this. currently I've found that you can get 60% of this by using the package update-notifier-common but according to this bugs.debian.org/cgi-bin/bugreport.cgi?bug=437176 debian team has choosen not to automatically update the motd because of security bugs that affected Ubuntu. –  Cerber May 26 '13 at 19:29
add comment

migrated from serverfault.com May 21 '13 at 22:41

This question came from our site for professional system and network administrators.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.