Re: aix shell script

From: rens (rens.groenewegen_at_xs4all.nl)
Date: 12/22/04

  • Next message: Gary: "Interesting performance difference"
    Date: Wed, 22 Dec 2004 00:29:18 +0100
    
    

    preventing double logins:

    put this in profile

    [ `who -i |grep -c -w ^$LOGNAME` -gt 1 ] && logout

    This goes for *every user* including you yourself........
    might want to exclude your self by using an if construct...... ;)

    timed log out:
    there is a timed-logout variable for the shell.
    does not log you out if you run another program in that shell ( like vi
    or whatever )

    try the 'w' command and check the output.

    you can script around that info, of course.

    *please note: it is not safe to blindly kill user sessions, they might
    loose data.
    *
    regards Rens

    Mike Z. Helm wrote:

    >On 9 Dec 2004 12:10:11 -0800, roger1991@hotmail.com
    >
    >
    >
    >>I need a shell script to stop duplicate concurrent logins. I need a
    >>second script to timeout a logged in inactive user after a
    >>predetermined time limit.
    >>Thanks for your help.
    >>
    >>
    >
    >I find it helpful to set their login shell to /bin/false.
    >
    >Everything runs so much smoother when I do that - except the phone tends
    >to ring a lot, so I forward it to the mailroom.
    >--
    >"Freedom is not always a good thing." -- P.R. Smith, a self-described conservative and Bush supporter
    >
    >


  • Next message: Gary: "Interesting performance difference"

    Relevant Pages

    • Root login timeouts - CONTINUED
      ... for bourne shell. ... write a script to clean up these logins. ... Kristopher T. Briscoe (unixboy) ...
      (SunManagers)
    • Re: detect shell script language
      ... In the 'old' days, when a user typed in a command, the interactive shell would immediately pass it off to 'exec' to execute. ... So, on return from exec with an error status, the shell would fork a copy of itself to try and run the script. ... As a result of the above, it was hard to tell whether the script was a Bourne shell or C shell, so the convention was introduced of using the Bourne shell no op command, as the first line in a Bourne shell script. ...
      (Debian-User)
    • Re: Call for input on comp.unix.shell FAQ
      ... >> questions and just tell people to FAQ it. ... The other level is how to write shell scripts. ... How can I remove whitespace characters within file names? ... Why one shouldn't use "echo" in a script? ...
      (comp.unix.shell)
    • SHELLdorado Newsletter 1/2003 - July 6th, 2003
      ... The "SHELLdorado Newsletter" covers UNIX shell script related ...
      (comp.unix.questions)
    • SHELLdorado Newsletter 1/2003 - July 6th, 2003
      ... The "SHELLdorado Newsletter" covers UNIX shell script related ...
      (comp.unix.shell)