#!/bin/bash

homedir=

if test -z $homedir; then
  echo "This script must be installed before usage"
  exit 1
fi

cd $homedir

. ./sysconfig


# kill Short-IDs Berkeley Database Daemon

pid_file=$sid_pid_file

#  The following snippet adopted from MySQL's support-files/mysql.server
#  Copyright Abandoned 1996 TCX DataKonsult AB & Monty Program KB & Detron HB
#  About MySQL see: http://mysql.com

if test -f $pid_file
then 
    pid=`cat $pid_file`

    echo "Killing berkeley_db_svc daemon with pid $pid"
    kill $pid

    sleep 1
    while [ -s $pid_file.verbose -a "$flags" != aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ]
      do
        [ -z "$flags" ] && echo -n "Wait for the daemon to exit" || echo -n "."
        flags=a$flags
        sleep 1
      done
      if [ -s $pid_file.verbose ]
         then echo " gave up waiting!"
      elif [ -n "$flags" ]
         then echo " done"
      fi
fi






