xref: /illumos-gate/usr/src/cmd/hal/tools/hal-fdi-validate.sh (revision b8052df9f609edb713f6828c9eecc3d7be19dfb3)
1#
2# hal-fdi-validate.sh : Validate one or more fdi(5) files
3#
4# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
5# Use is subject to license terms.
6#
7# Licensed under the Academic Free License version 2.1
8#
9
10usage() {
11	echo "Usage: hal-fdi-validate [-f dtd] file [file ...]"
12	exit 1
13}
14
15if [ "$1" = "-f" ]; then
16	if [ "foo$2" != "foo" ] ; then
17		DTD="$2"
18		shift 2
19	else
20		usage
21	fi
22else
23	DTD="/usr/share/lib/xml/dtd/fdi.dtd.1"
24fi
25
26if [ $# -eq 0 ]; then
27	usage
28fi
29
30xmllint --noout --dtdvalid $DTD $*
31