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

⟦f800ea80e⟧ TextFile

    Length: 2092 (0x82c)
    Types: TextFile
    Notes: UNIX file
    Names: »addhost«

Derivation

└─⟦8c4f54e61⟧ Bits:30004068/disk2.imd Interactive TCP/IP v.1.2
└─⟦8c4f54e61⟧ UNIX Filesystem
    └─⟦this⟧ »hb/new/usr/admin/menu/packagemgmt/tcpipmgmt/addhost« 

TextFile

#ident	"@(#)addhost	3.1 - 88/06/01"

#ident	"@(#)addhost	1.2 - 87/07/28"
#	This shell is used to add a host to /etc/hosts and
#	to /etc/hosts.smtp

PACKAGE="Extended Networking Utilities"
PATH=:/bin:/usr/bin:/usr/lbin
HOST=/etc/hosts
EQUIV=/etc/hosts.equiv
SMTP=/etc/hosts.smtp
XDIR=$MENUTOP/menu/packagemgmt/tcpipmgmt
cd $XDIR

MYNAME=`uname`
FIRST=true

flags="-qq -k$$"
trap exit 1 2 15

if [ -f "$HOST" -a \( ! -w "$HOST" -o ! -r "$HOST" \) ]; then
	admerr $0 "Can't write and read '$HOST'\nCan't do add operation!\n"
	exit
fi
if [ -f "$SMTP" -a \( ! -w "$SMTP" -o ! -r "$SMTP" \) ]; then
	admerr $0 "Can't write and read '$SMTP'\nCan't do add operation!\n"
	exit
fi

echo "
This procedure is used to create entries in the
$PACKAGE '$HOST' file.
This file contains information which this machine, '$MYNAME',
uses to contact remote host.
"

while $FIRST || chkyn ${flags} -f  "
Add another entry to the hosts file?"  || exit
do
FIRST=false

	NAME=`chkyn ${flags} -ref "
Enter the domain name of the host you want to add:" \
	'^[0-9A-Za-z][0-9A-Za-z.]*$' 'Name is letters, digits, "." character only'`

	ADDR=`chkyn ${flags}  -h'?' -H"
This is the network address on which the remote host is listening
for connection requests.  The address format is defined by the individual
network.  Connections to ${NAME} over Ethernet TCP/IP are of the form:
xxx.xxx.xxx.xxx where each x is a numeric digit, such as 128.212.32.3" \
			-ref "
Enter the network address that will be used for the connection to machine
'$NAME'.   Address: [?] " \
		'[0-9][0-9.]*$' 'Digits, and "." character only'`

	ALIAS=`chkyn ${flags} -ref "
Enter the alias name of the host you want to add:" \
	'^[0-9A-Za-z][0-9A-Za-z.]*$' 'Name is letters, digits, "." character only'`

	LINE="$ADDR	$NAME	$ALIAS"
	echo "\nHere is the hosts file entry for machine '$NAME.'"
	/bin/sh _hostprint $ADDR $NAME $ALIAS

	if  chkyn ${flags} -f "
Should this be entered into the '$HOST' file?"
	then
		cat <<-! >> $HOST
			$LINE
		!
		cat <<-! >> $SMTP
			$NAME
		!
		echo "\n **** host '$NAME' has been added to '$HOST' *****\n"
	fi
done