File pegutil.sh of Package tog-pegasus

#!/bin/sh

if [ "x$1" = "x" ] || [ "x$1" == "x--help" ]; then
  echo "Usage: $(basename $0) <command> [args ...]"
  echo ""
  echo "$(basename $0) will check to see if the Pegasus cimserver is running."
  echo "If it is not running, cimserver will be started with minimal services. "
  echo "The specified command will be executed with the provided arguments, and"
  echo "then the cimserver will be stopped, if it was not previously running."
  exit 1 
fi

which $1 > /dev/null
if [ "x$?" != "x0" ]; then
  echo "Invalid command: $1"
  exit 1
fi

INIT_SCRIPT=/etc/init.d/tog-pegasus
CIMSERVER=/usr/sbin/cimserver

PEG_RUNNING=""
if [ "$YAST_IS_RUNNING" != "instsys" ] ; then
  $INIT_SCRIPT status &> /dev/null
  PEG_RUNNING=$?
fi

if [ "x$PEG_RUNNING" != "x0" ]; then
  $CIMSERVER \
	enableIndicationService=false \
	enableHttpsConnection=false \
	enableHttpConnection=false
fi

$@
rv=$?

if [ "x$PEG_RUNNING" != "x0" ]; then
  $CIMSERVER -s &> /dev/null
fi

exit $rv

openSUSE Build Service is sponsored by