File SuSEconfig.sblim-cmpi-smbios of Package sblim-cmpi-smbios
#! /bin/sh
# Copyright (c) 2004 SuSE Linux AG Nuremberg, Germany.  All rights reserved.
#
# Author: Viktor Mihajlovski <mihajlov@de.ibm.com>
# 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
# Run only once
RUNFILE=/var/adm/SuSEconfig/run-sblim-cmpi-smbios
test -s $RUNFILE || exit 0
if rpm -q pegasus-wbem; then
    # Stop CIMOM if running
    if /etc/init.d/pegasus-wbem status; then
	/etc/init.d/pegasus-wbem stop
	_RESTART=1
    fi
    # Register Providers
    REPOSITORYLOC=/var/cache/pegasus
    cimmofl -R $REPOSITORYLOC -n root/cimv2 /usr/share/cmpi/mof/Linux_BIOS.mof
    cimmofl -R $REPOSITORYLOC -n root/PG_InterOp /usr/share/cmpi/mof/Linux_BIOSRegistration.mof
    # Restart CIMOM
    if [ -n "$_RESTART" ] ; then
	/etc/init.d/pegasus-wbem start
    fi
    rm -f $RUNFILE
    exit 0
fi
if rpm -q openwbem; then
    # Stop CIMOM if running
    if /etc/init.d/owcimomd status; then
	/etc/init.d/owcimomd stop
	_RESTART=1
    fi
    # Register Providers
    sed "s/cmpi:/cmpi::/g" /usr/share/cmpi/mof/Linux_BIOS.mof > /tmp/Linux_BIOS.mof.$$
    owmofc -d /var/lib/openwbem /tmp/Linux_BIOS.mof.$$
    rm -f /tmp/Linux_BIOS.mof
    # Restart CIMOM
    if [ -n "$_RESTART" ] ; then
	/etc/init.d/owcimomd start
    fi
    rm -f $RUNFILE
    exit 0
fi