#!/bin/ksh
#
#	/usr/lib/pick/upditab
#	12May93 apk
#	Change /etc/inittab to allow turnkey ap logins on
#	ports defined in /usr/lib/pick/inittab.ttys.
#
#  Run this script with stdin redirected from the inittab updates
#  file to be used (normally /usr/lib/pick/inittab.ttys).
#  The following should be added to /etc/rc:
#
#	if -s /usr/lib/pick/inittab.ttys -a -x /usr/lib/pick/upditab
#	then
#		/usr/lib/pick/upditab </usr/lib/pick/inittab.ttys
#		echo "/usr/lib/pick/inittab.ttys updates installed"
#	fi
#
#
#  The inittab.ttys file contains the inittab entries to be
#  loaded when the system boots and after the comm devices have
#  done their configuration changes to inittab.
#  Only lines which look like inittab lines are loaded into inittab.
#  The "chitab" command does the work of changing inittab.
#  "inittab.ttys" should only contain defs for turnkey ap logons.
#  Let smit control ports with gettys in /etc/inittab.
#
#  This is an improvement over Pick Systems copying of inittab.pick
#  over /etc/inittab because it only updates those lines which
#  pertain to ttys so you don't accidentally clobber inittab.
#
#  pfr - of rsc - switch line for 5.25 differences

while read idef
do
	if expr "$idef" : 'tty[0-9]*:2:respawn:ap -[0-9]*' >/dev/null
	then
		chitab "$idef"
	fi
done
