#! /bin/sh
# Copyright (c) 2002 SuSE Linux AG Nuremberg, Germany.  All rights reserved.
#
# Author: Karl Eichwalder <ke@suse.de>, 2002
# check if we are started as root
# only one of UID and USER must be set correctly
if test "$UID" != 0 -a "$USER" != root; then
  echo "You must be root to start $0."
  exit 1
fi
test -n "$ROOT" && exit 0
test -s /var/adm/SuSEconfig/run-libxml2 || exit 0
xmlcatbin=/usr/bin/xmlcatalog
[ -x $xmlcatbin ] || exit 0
if [ ! -d /etc/xml -a -w /etc ]; then
  install -d -m 755 /etc/xml
fi
ROOTCATALOG=/etc/xml/catalog
if [ ! -r $ROOTCATALOG ] ; then
   $xmlcatbin --noout --create $ROOTCATALOG
fi
if [ ! -r $ROOTCATALOG ] ; then
  echo Failed creating XML Catalog root $ROOTCATALOG
fi
exit 0
