#!/bin/sh
#ident	"@(#)sadmin3b2:admin/menu/diskmgmt/harddisk/display	1.8"
# $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.
#menu# display hard disk partitioning
#help# 
#help#	Display the partitioning of a hard disk.  Also shows the
#help#	hardware location of the selected disk.

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

PATTERN=`cd /dev/rdsk; ls *s0 | sed s/s0$//p`
ddrive=`selectdevice -c $$ /dev/rdsk $PATTERN`
lddrive=${ddrive}s0
if [ "$lddrive" = "" ]
then
	exit 0
fi

if [ ! -c ${lddrive} ]
then
	exit 0
fi

  echo "Displaying ${ddrive} partitioning"

/etc/prtvtoc ${lddrive}
if [ $? -ne 0 ]
then
	echo "\tDisplay of the hard disk partitioning failed."
	echo "\tSuggestions:  1) The disk may not be partitioned."
	echo "\t              2) This may be a DYNIX 3 compatable disk with no VTOC."
	echo "\t              3) There may be a problem with the hard disk itself."
	echo "\t                 Call your service representative."
	exit 1
fi
exit 0
