Cover V09, I04
Article
Listing 1
Listing 2
Listing 3
Listing 4
Listing 5
Listing 6
Figure 1

apr2000.tar


Listing 5: startsysuser

#!/bin/sh
#################################################################
# "@(#)startsysuser"        
# Shellprogram    : startsysuser
# Description     : Check that the users are included in the group 
# Function        : If fgrep gets a true value from id then the 
#                 : users are authorized.                      
# Date            : 991009
# Author          : Mats Brymér WM-data
# Version         : 1.0
#################################################################

#
# Shell variable
#

TOP=/usr/local;export TOP
LOG=$TOP/log/startsysuser;export LOG
BIN=$TOP/bin;export BIN
SHELL=/bin/sh;export SHELL

#
# Check that users are included in the group sysuser
#
# id -a is for Solaris, other operating systems don't need this.
#

if id -a | fgrep sysuser > /dev/null
then

#
# If true, write to logfile
# Users .profile and $SHELL executes
# 

    echo `date`,`id`,$TERM  >>$LOG
    TERM=vt220;export TERM
    if [ -f $HOME/.profile ]
    then
        . $HOME/.profile
    fi
    exec $SHELL
else 

#
# If the user is not included in the group sysuser. There is a message
# on the screen to the user. And a logpost is written. After that the 
# session is ended. 
#

    echo "Access denied"


    echo "CHECK,`date`,`id`,$TERM">>$LOG
exit
fi