[K12OSN] Multiple logins ???
norbert
bear2bar at netscape.net
Wed Sep 22 12:01:54 UTC 2004
HI,
Thanks for the input, but I had tried the code without the "done" and I
get the same error, suggestions please...
thks
norbert
sysadmin at handsworth.bham.sch.uk wrote:
>On Tuesday 21 Sep 2004 4:33 pm, norbert wrote:
>
>
>>Hi Martin,
>>
>>Thanks I'm trying the script but I've run into two problems;
>>
>>1) After changeing the paths for linux and adding a ";" and "done"
>>please see code
>>
>># 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
>>
>>I saved the script and tried running it alone I get "line 16: syntax
>>error: unexpected end of file" can the error be clarified and corrected
>>please as it looks correct ......
>>
>>
>
>Looks to me it is the done causing your problems. Typical syntax is :-
>for f in `ls` ; do
> something
>done
>
>
>
>>Second where do I put this scrip in /etc/profile ? or as an independent
>>executable ??
>>
>>
>
>Nup; just chuck the code on the end of /etc/profile. You should probably
>change the wait to a sleep 2 otherwise your message won't be visible. You
>should also possibly bypass this code for select users (root might be a good
>one) and be sure to stay logged in while you are fiddling with /etc/profile
>(ie test it using a different console).
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/k12osn/attachments/20040922/375507b2/attachment.htm>
More information about the K12OSN
mailing list