Listing 6: sus
#!/bin/sh
#################################################################
# "@(#)sus"
# Shellprogram : sus
# Description : Set the TERM variable and su - to user
# Function : Use two argument application groupname and
# : username
# Date : 991009
# Author : Mats Brymér WM-data
# Version : 1.0
#################################################################
Fel(){
echo "Usage
sus groupid userid
"
}
#
# Set TERM
#
if ls /usr/local/bin/start* |fgrep $1
then
TERM=$1;export TERM
else
Fel
exit
fi
#
# su command
#
if fgrep $2 /etc/passwd
then
su - $2
else
Fel
fi
|