[K12OSN] Multiple logins ???

Martin Woolley sysadmin at handsworth.bham.sch.uk
Wed Sep 22 07:54:59 UTC 2004


On Tuesday 21 Sep 2004 5:54 pm, David Trask wrote:
> "Support list for opensource software in schools." <k12osn at redhat.com> on
>
> Tuesday, September 21, 2004 at 11:33 AM +0000 wrote:
> ># This user is only allowed a single login instance
> >tty=`/usr/bin/tty`     # Get tty to test for multiple login
> >
> >if /bin/ps -u $LOGNAME | /bin/grep -v UID | /bin/grep -v "${tty##/dev/}" ;
> >then
> >       /bin/cat <<-EOM >&2
> >
> >       You already have an active session on this system and you are
> >       allowed a single session.  This session will now be closed.
> >
> >       EOM
> >       wait
> >       exit
> >fi
> >done
>
> Just curious...should it be  $LOGNAME or $USERNAME


[test3 at marge test3]$ echo $LOGNAME
test3
[test3 at marge test3]$ echo $USERNAME

[test3 at marge test3]$

I'd say use $LOGNAME
--
Regards
Martin Woolley
ICT Support
Handsworth Grammar School
Isis Astarte Diana Hecate Demeter Kali Inanna



*************************************************************
This email and any files transmitted with it are confidential
and intended solely for the use of the individual or entity 
to whom they are addressed. If you have received this email 
in error please notify postmaster at bgfl.org

The views expressed within this email are those of the 
individual, and not necessarily those of the organisation
*************************************************************





More information about the K12OSN mailing list