DataMuseum.dk

Presents historical artifacts from the history of:

Regnecentalen RC-900

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Regnecentalen RC-900

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download

⟦0fb370111⟧ TextFile

    Length: 3730 (0xe92)
    Types: TextFile
    Notes: UNIX file
    Names: »ddaremove«

Derivation

└─⟦0cfe73749⟧ Bits:30004154/config.imd SW95707I VP/ix MS-DOS emulator Rel. 1.1
└─⟦0cfe73749⟧ UNIX Filesystem
    └─⟦this⟧ »vc/new/usr/admin/menu/packagemgmt/vpixmgmt/ddaremove« 

TextFile

#
#  Copyrighted as an unpublished work.
#  (c) Copyright 1988 INTERACTIVE Systems Corporation
#  All rights reserved.
#
#  RESTRICTED RIGHTS
#
#  These programs are supplied under a license.  They may be used,
#  disclosed, and/or copied only as permitted under such license
#  agreement.  Any copy must contain the above copyright notice and
#  this restricted rights notice.  Use, copying, and/or disclosure
#  of the programs is strictly prohibited unless otherwise provided
#  in the license agreement.
#

#ident  "@(#)ddaremove	1.1 - 88/07/27"

#menu# remove a DDA device from the VP/ix Environment
#help#
#help#  This procedure allows you to "deregister" a device that was
#help#  previously installed for Direct Access in the VP/ix Environment.
#help#
#help#  Once a device has been deregistered, VP/ix users may no longer
#help#  request access to it by specifying its name in their vpix.cnf files.


###########################################################################
# function to ask whether user wants to remove another device
#     returns 0 if OK to continue, 1 to quit
###########################################################################

askmore() {

REPLY=`checkyn -fe "
Do you want to remove another DDA device?"`

if [ "${REPLY}" = "n" ]
then
    return 1
else
    return 0
fi
}

###########################################################################
# function to get logical name of dda device
#     returns 0 if OK, else exits
###########################################################################

getname() {
LOGICAL=
while true
do
    echo "\nPlease enter the logical name of the DDA device you want to remove."
    echo "(Lower case letters will be converted to upper case letters.)\n"
    read LOGICAL

    if [ "${LOGICAL}" ]
    then

	# Convert name to upper-case

	LOGICAL=`echo ${LOGICAL} | tr "[a-z]" "[A-Z]"`

	# Ensure name is <= 12 characters in length

	if [ `expr \`echo "${LOGICAL}" | wc -c\`` -gt 12 ]
	then
	    echo "\nThe name ${LOGICAL} is too long."
	    echo "DDA device names must not be longer than 10 characters."
	    LOGICAL=
	else
	    # Check if device already installed

	    ${BIN}/ectcheck -N dda -L ${LOGICAL} 2> /dev/null
	    if [ $? -ne 1 ]
	    then
		echo "\nNo DDA device with the logical name \"${LOGICAL}\" \
has been installed."
		LOGICAL=
	    fi
	fi
    fi

    if [ -z "${LOGICAL}" ]
    then
	askmore
	if [ $? -eq 1 ]
	then
	    return 1
	fi
    else
	return 0
    fi
done
}


###########################################################################
# MAIN ROUTINE
###########################################################################

trap 'exit 0' 1 2 3 9 15

BIN=/usr/vpix/etc
FLAGS="-qq -k$$"

answer=`checkyn ${FLAGS} -fe -H"
This procedure allows you to deregister an add-on board
that was installed for Direct Access in the VP/ix Environment." "
Do you wish to remove a DDA device?"`

if [ "${answer}" = "n" ]
then
    exit 0
fi


# check whether it's OK to continue
# (must be root, VP/ix must be installed, and its version must be > 1.0.8)

${BIN}/iemcheck
if [ $? -ne 0 ]
then
    exit 1
fi

# down to business

while true
do
    # get logical name from user
    # (function returns 0 to continue, 1 to quit)

    getname
    if [ $? -eq 1 ]
    then
	exit 0
    fi

    # Remove the device

    ${BIN}/ectremove -L ${LOGICAL} # 2>&1 > /dev/null
    if [ $? != 0 ]
    then
	echo ${CLEAR}
	echo "DDA device ${LOGICAL} could not be deregistered."
    else
	echo "DDA device ${LOGICAL} deregistered."
    fi

    # ask whether to continue with another device
    # (function returns 0 to continue, 1 to quit)

    askmore
    if [ $? -eq 1 ]
    then
	exit 0
    fi

    # OK to continue - repeat the loop

done