#!/bin/sh #ident "@(#)init.dsnmprad 1.5 06/10/98 SMI" # # # Copyright 06/10/98 Sun Microsystems, Inc. All Rights Reserved # ECHO=/bin/echo GREP=/bin/grep PS=/bin/ps KILL=/bin/kill CAT=/bin/cat AWK=/bin/awk # # Kill named process(es) # (The name is troncated to 8 characters) # killproc() { pid=`$PS -e | $GREP " $2" | $GREP -v init | $AWK '{ print $1 }'` if [ "$pid" != "" ] then $KILL -$1 $pid return 0 else return 1 fi } # # Variables # PKG=SUNWsds BASEDIR=`/bin/pkgparam $PKG BASEDIR 2>/dev/null` if [ -z "$BASEDIR" ] # pkg not installed or installed several times then BASEDIR=/opt # set default. Maybe the dir is nfs mounted fi case "$1" in 'start') # # if we are in 2.6 and the master relay is installed, do nothing # if pkgparam SUNWsacom BASEDIR >/dev/null 2>&1 then exit 0 fi if [ ! -f /etc/opt/SUNWconn/ldap/current/dsnmprad.conf ] then exit 0 fi if [ ! -x $BASEDIR/SUNWconn/lib/dsnmprad ] then $ECHO "$BASEDIR/SUNWconn/lib/dsnmprad not found" exit 1 fi pid=`ps -fe | grep dsnmprad | grep -v grep | grep -v init | awk '{print $2}'` if [ -n "$pid" ] then echo "Another dsnmprad process is already running" else $ECHO "Starting dsnmprad ... \c" $BASEDIR/SUNWconn/lib/dsnmprad sleep 0 fi ;; 'stop') $ECHO "Killing dsnmprad ..." killproc INT dsnmprad ;; *) $ECHO "Usage: $0 { start | stop }" ;; esac exit 0