# $Copyright:	$
# Copyright (c) 1984, 1985, 1986, 1987, 1988, 1989, 1990 
# Sequent Computer Systems, Inc.   All rights reserved.
#  
# This software is furnished under a license and may be used
# only in accordance with the terms of that license and with the
# inclusion of the above copyright notice.   This software may not
# be provided or otherwise made available to, or used by, any
# other person.  No title to or ownership of the software is
# hereby transferred.
#ident	"$Header: nodename 1.4 90/02/13 $@(#)sadmin:admin/menu/syssetup/nodename	1.6"
#menu# set the node name of this machine
#help#	This allows you to change the "node name" of this machine.  The
#help#	"node name" is used by various communications networks to identify
#help#	this machine.

flags="-qq -k$$"	# flags for checkyn to implement [q] (quit)

trap 'exit 0' 1 2 15

uname=`uname -n`

checkyn ${flags} -f  -H '
	The "node name" is used by various communications networks to identify
	this machine.' \
	"This machine is currently called \"${uname}\".
Do you want to change it?"  ||  exit 0

name=`checkre ${flags} -fe "What name do you want to give it? [q]" \
	'.' 'There must be a name.' \
	'^[0-9a-zA-Z]\{1,\}$' 'Only letters and numbers are permitted.' \
	'^.\{1,8\}$' 'No more than 8 letters and numbers are permitted.'`

uname -S ${name}
date +"#	Node name changed %D %T.
uname -S ${name}" >/etc/nodename
