|
|
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: 3122 (0xc32)
Types: TextFile
Notes: UNIX file
Names: »addrc911«
└─⟦6c3d40b06⟧ Bits:30004150 SW95702I LANCOM 2.1
└─⟦6c3d40b06⟧ UNIX Filesystem
└─⟦this⟧ »LM/new/usr/admin/menu/packagemgmt/RC911mgmt/addrc911«
#ident# %W% %E% %U% FK
#menu# enable an RC911 to access this load server
#help#
#help# This procedure configures this server so that an RC911
#help# can download from this machine. It also adds various
#help# directories and files used by the RC911.
groupname=lanmux
trap 'exit 0' 1 2 3 9 15
flags="-qq -k$$"
# Make sure that adapter env. has already been installed on the system.
if [ ! -s /usr/options/AE.name ]
then
/bin/echo "The Rc Adapter Environment has not been installed on your system."
/bin/echo "Please use Sysadm to install the Rc Adapter Environment."
exit 1
fi
# Make sure that mux env. has already been installed on the system.
if [ ! -s /usr/options/ME.name ]
then
/bin/echo "The Rc Multiplexer Environment has not been installed on your system."
/bin/echo "Please use Sysadm to install the Rc Multiplexer Environment."
exit 1
fi
while :
do
inst=`checkyn ${flags} -fe -H"
This procedure sets up an RC911 environment
to allow it to download from this server" "
Do you wish to set up an RC911 to use this load server?"`
[ "${inst}" = "n" ] && break
# Ask for lanmux id
loginid=`checkre ${flags} -fet -H"
The RC911 UNIT ID is found on an label afixed to the
RC911 unit. The format of the id is: lmXXXXXX or #XXXXXX,
where the XXXXXX is six unique characters for this RC911 unit" \
"Enter the RC911 UNIT ID: XXXXXX [?, q]" '^[0-9a-fA-F]\{6\}$' -o '^lm[0-9a-fA-F]\{6\}$' \
"Answer is not XXXXXX or lmXXXXXX" |
tr 'A-F' 'a-f' | sed -e '/^lm/!s/\(.*\)/lm\1/p'`
# Make sure that the user doesn't exists
if grep "^${loginid}:" /etc/passwd >/dev/null 2>&1
then
echo "\\tRC911 UNIT ID '${loginid}' already exists."
continue
fi
username="Lanmux ${loginid}"
logdir="/usr/${loginid}"
if [ -n "`ls -d ${logdir} 2>/dev/null`" ]
then
echo "A file or directory allready exits with the name ${logdir}"
continue
fi
# Sort 3rd field in /etc/passwd then cut 3rd field
# from last line. Increment this field by 1 to
# come up with a unique new user ID number.
userid=`sort -t: +2n /etc/passwd | tail -1 |
cut -d: -f3`
userid=`expr ${userid} + 1`
# don't allow user ID numbers less than minid
if [ ${userid} -lt 100 ]
then
userid=100
fi
groupid=`grep "^${groupname}:" /etc/group | cut -d: -f3`
if [ -z "${groupid}" ]
then
echo "\\tThe ${groupname} is not a known group name."
for groupname in sys root bin other
do
groupid=`grep "^${groupname}:" /etc/group | cut -d: -f3`
test -n "${groupid}" && break
done
echo "\\t${groupname} is chosen"
fi
export loginid userid groupid username logdir
/bin/sh -c '
trap "" 1 2 3 15
set -e
umask 002
mkdir ${logdir}
cd ${logdir}
ln /usr/cards/mux1/mux.CONF LANMUX.CONF
if [ ! -f /usr/rcdialog/data/LANMUX.d ]
then
ln /usr/rcdialog/data/mux.d /usr/rcdialog/data/LANMUX.d
fi
ln /usr/cards/lanmux/* /usr/cards/lan1/CSPTERM.POF .
chgrp ${groupid} .
chown ${userid} .
echo "${loginid}::${userid}:${groupid}:${username}:${logdir}:/etc/nologin" >>/etc/passwd
echo "RC911 UNIT ${loginid} installed."
exit 0
' || {
admerr $0 'Failure in attempting to install new RC911 UNIT.'
[ -d ${logdir} ] && rm -rf ${logdir}
exit 1
}
done