|
|
DataMuseum.dkPresents historical artifacts from the history of: Regnecentalen RC-900 |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Regnecentalen RC-900 Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T U a
Length: 3037 (0xbdd)
Types: TextFile
Notes: UNIX file
Names: »addvpixuser«
└─⟦2aa344708⟧ Bits:30004154/disk2.imd SW95707I VP/ix MS-DOS emulator Rel. 1.1
└─⟦2aa344708⟧ UNIX Filesystem
└─⟦this⟧ »vp/new/usr/admin/menu/packagemgmt/vpixmgmt/addvpixuser«
#ident# @(#)addvpixuser 1.2 - 88/06/01
#menu# enable users to use the VP/ix Environment
#help#
#help# This procedure configures a user's profile so that they
#help# can run VP/ix. It also adds various directories and files
#help# used by VP/ix under their $HOME directory.
trap 'exit 0' 1 2 3 9 15
flags="-qq -k$$"
# Make sure that VP/ix has already been installed on the system.
if [ ! -s /usr/options/vp.name ]
then
/bin/echo "The VP/ix Environment has not been installed on your system."
/bin/echo "Please use Sysadm to install the VP/ix Environment."
exit 1
fi
while true
do
inst=`checkyn ${flags} -fe -H"
This procedure sets up a user's environment
to allow the use of the VP/ix Environment" "
Do you wish to set up a new VP/ix user?"`
if [ "${inst}" = "n" ]
then
break
fi
# Make sure that the user exists
echo "\nEnter the User's login ID : \c"
read name
if grep -i "^$name:" /etc/passwd >/dev/null 2>&1
then
:
else
echo "\nUser $name doesn't exist"
echo "Please use Sysadm adduser to Create a Login Account"
echo "Terminating user installation for ${name}.\n"
continue
fi
# Get the user's home directory by reading the proper field
# from the /etc/passwd file. We assume that his home directory
# has a .profile file. This implicitly assumes that the user's
# shell is KSH,CSH,SH or RSH.
usrhome=`grep "^$name:" /etc/passwd | cut -f6 -d':'`
if [ "$?" != "0" -o "$usrhome" = "" ]
then
echo "\nUnable to find the HOME directory for user $name"
echo "Terminating user installation for ${name}.\n"
continue
fi
if [ ! -d $usrhome ]
then
echo "\nUser's HOME directory doesn't exist: '$usrhome'"
echo "Terminating user installation for ${name}.\n"
continue
fi
# Check to see if user seems to be installed already; if so, exit.
if grep "VPIXCNF" $usrhome/.profile >/dev/null 2>&1 || [ -d $usrhome/vpix ]
then
echo "\nUser $name appears to already be a VP/ix user."
echo "Terminating user installation for ${name}.\n"
continue
fi
# Create $HOME/vpix and subdirectories and files
mkdir $usrhome/vpix
cp /usr/vpix/defaults/vpix.cnf $usrhome/vpix
chown $name $usrhome/vpix $usrhome/vpix/vpix.cnf
chmod 644 $usrhome/vpix/vpix.cnf
mkdir $usrhome/vpix/unixbin
cp /usr/vpix/unixbin/rununix.exe $usrhome/vpix/unixbin
chown $name $usrhome/vpix/unixbin $usrhome/vpix/unixbin/rununix.exe
# Append the important stuff to the .profile file
cat >> $usrhome/.profile <<!
VPIXCNF=\$HOME/vpix/vpix.cnf
DOSPATH=/usr/vpix/dosbin:.
PATH=\$PATH:\$DOSPATH
export DOSPATH VPIXCNF
!
cdrive=`checkyn -fe -Dn -H"
Refer to the VP/ix Environment System Maintenance Guide for details
on the C: drive. Choose the default answer, for now." "
Should user $name have a private copy
of the C: drive? (Default is \"n\")"`
if [ "${cdrive}" = "y" ]
then
cp /usr/vpix/defaults/C: $usrhome/vpix
chown $name $usrhome/vpix/C:
chmod 644 $usrhome/vpix/C:
ed $usrhome/vpix/vpix.cnf >/dev/null 2>&1 <<!
/C:/s;/usr/vpix/defaults;$usrhome/vpix
w
q
!
fi
echo "\nUser $name can now use the VP/ix Environment\n"
done
exit 0