motd – UNIX – AIX – different welcome screens for diff users

is it possible to segregate different motd files for different users ? So Admin gets a different message and others diff one….

Answer

After a long search, I came up with the idea:

edit the /etc/profile and add the below loop to the end but before TRAP..

#!/bin/ksh
ROOTY=$(whoami)
if [ ${ROOTY} != root ] ; then
    for i in `who am i |awk {'print $1'}` 
    do
        RID=$i
        UNIXADM=$(sudo cat /home/root/unixusers | grep -Fx $RID | wc -l)
        if [ ${UNIXADM} == 1 ] ; then
            cat /etc/motd.unixusers
        fi
    done
fi

where /home/root/unixusers will be the user list /etc/motd.unixusers is the user specific motd

Leave a Reply

Your email address will not be published. Required fields are marked *