#!/bin/sh

if [ "$#" = "0" ]
then
	set `devnm /`
	ROOT=`echo $1 | sed -e 's/s[1-9]$/s0/'`
	echo "\n${ROOT}:"
	rdb -H $ROOT
	exit $?
fi

if [ "$#" != "1" -o "$1" != "-all" ]
then
	echo "usage: showrdb [ -all ]" 1>&2
	exit 1
fi

DEVS=`/usr/amiga/lib/atdevs`

if [ "$DEVS" = "" ]
then
	echo "showrdb: can't find any disk drives" 1>&2
	exit 1
fi

for i in $DEVS
do
	echo "\n/dev/dsk/c${i}d0s0:"
	rdb -H /dev/dsk/c${i}d0s0
done
